[GRASS-SVN] r52902 - grass/branches/releasebranch_6_4/raster/r.sunmask

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Aug 25 06:43:07 PDT 2012


Author: mmetz
Date: 2012-08-25 06:43:06 -0700 (Sat, 25 Aug 2012)
New Revision: 52902

Modified:
   grass/branches/releasebranch_6_4/raster/r.sunmask/main.c
Log:
hamish: don't segfault on long map names (#800), + G_command_history()

Modified: grass/branches/releasebranch_6_4/raster/r.sunmask/main.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.sunmask/main.c	2012-08-25 13:39:01 UTC (rev 52901)
+++ grass/branches/releasebranch_6_4/raster/r.sunmask/main.c	2012-08-25 13:43:06 UTC (rev 52902)
@@ -533,11 +533,8 @@
 
     /* writing history file */
     G_short_history(outname, "raster", &hist);
-    sprintf(hist.edhist[0], "%s", *argv);
-    sprintf(hist.datsrc_1, "raster elevation file %s", name);
-    /* bug: long lines are truncated */
-    sprintf(hist.datsrc_2, "%s", G_recreate_command());
-    hist.edlinecnt = 3;
+    G_snprintf(hist.datsrc_1, RECORD_LEN, "raster elevation map: %s", name);
+    G_command_history(&hist);
     G_write_history(outname, &hist);
 
     exit(EXIT_SUCCESS);



More information about the grass-commit mailing list