[GRASS-SVN] r52914 - grass/trunk/raster/r.quant

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Aug 25 12:17:24 PDT 2012


Author: mmetz
Date: 2012-08-25 12:17:23 -0700 (Sat, 25 Aug 2012)
New Revision: 52914

Modified:
   grass/trunk/raster/r.quant/read_rules.c
Log:
r.quant: fix buffer size, fix fp precision

Modified: grass/trunk/raster/r.quant/read_rules.c
===================================================================
--- grass/trunk/raster/r.quant/read_rules.c	2012-08-25 18:41:56 UTC (rev 52913)
+++ grass/trunk/raster/r.quant/read_rules.c	2012-08-25 19:17:23 UTC (rev 52914)
@@ -49,8 +49,8 @@
     if (Rast_is_d_null_value(&old_dmin) || Rast_is_d_null_value(&old_dmax))
 	G_message(_("Old data range is empty"));
     else {
-	sprintf(buff, "%.10f", old_dmin);
-	sprintf(buff2, "%.10f", old_dmax);
+	sprintf(buff, "%.15g", old_dmin);
+	sprintf(buff2, "%.15g", old_dmax);
 	G_trim_decimal(buff);
 	G_trim_decimal(buff2);
 	G_message(_("Old data range is %s to %s"), buff, buff2);
@@ -66,7 +66,7 @@
 
 int read_rules(const char *filename)
 {
-    char buf[256];
+    char buf[1024];
     DCELL dLow, dHigh;
     CELL iLow, iHigh;
     int line, n, nrules = 0;



More information about the grass-commit mailing list