Update of /cvsroot/meshdb/www/db2
In directory usw-pr-cvs1:/tmp/cvs-serv30768
Modified Files:
index.php
Log Message:
avoid division by zero error
Index: index.php
===================================================================
RCS file: /cvsroot/meshdb/www/db2/index.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- index.php 10 Aug 2002 11:42:39 -0000 1.3
+++ index.php 10 Aug 2002 11:46:37 -0000 1.4
@@ -84,7 +84,7 @@
, $db)
or die(mysql_error($db));
$row = mysql_fetch_assoc($result);
-$mwid = max( $row["maxn"]-$row["minn"] , $row["maxe"]-$row["mine"] );
+$mwid = max(max( $row["maxn"]-$row["minn"] , $row["maxe"]-$row["mine"] ), 1);
$mapscale = $len/$mwid/1.1;
$mapn = ($row["minn"]+$row["maxn"])/2;
$mape = ($row["mine"]+$row["maxe"])/2;
|