[GRASS-SVN] r56877 - grass/branches/develbranch_6/display/d.barscale

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jun 22 04:01:51 PDT 2013


Author: hamish
Date: 2013-06-22 04:01:51 -0700 (Sat, 22 Jun 2013)
New Revision: 56877

Modified:
   grass/branches/develbranch_6/display/d.barscale/main.c
Log:
avoid undefined behaviour in sprintf() (#1324)

Modified: grass/branches/develbranch_6/display/d.barscale/main.c
===================================================================
--- grass/branches/develbranch_6/display/d.barscale/main.c	2013-06-22 09:02:40 UTC (rev 56876)
+++ grass/branches/develbranch_6/display/d.barscale/main.c	2013-06-22 11:01:51 UTC (rev 56877)
@@ -1,4 +1,3 @@
-
 /****************************************************************************
  *
  * MODULE:       d.barscale
@@ -174,9 +173,9 @@
     else if (mouse_query(top->answer, fontsize)) {
 	char cmdbuf[512];
 
-	sprintf(cmdbuf, "%s at=%.2f,%.2f", argv[0], east, north);
-	sprintf(cmdbuf, "%s bcolor=%s", cmdbuf, opt1->answer);
-	sprintf(cmdbuf, "%s tcolor=%s", cmdbuf, opt2->answer);
+	sprintf(cmdbuf, "%s at=%.2f,%.2f bcolor=%s tcolor=%s fontsize=%s",
+		argv[0], east, north, opt1->answer, opt2->answer, fsize->answer);
+
 	if (top->answer)
 	    strcat(cmdbuf, " -t");
 	if (feet->answer)



More information about the grass-commit mailing list