[GRASS-SVN] r44983 - grass/branches/develbranch_6/vector/v.digit

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jan 12 05:23:02 EST 2011


Author: marisn
Date: 2011-01-12 02:23:01 -0800 (Wed, 12 Jan 2011)
New Revision: 44983

Modified:
   grass/branches/develbranch_6/vector/v.digit/i_face.c
Log:
v.digit Fix sprintf abuse (sprintf source and target should not overlap)

Modified: grass/branches/develbranch_6/vector/v.digit/i_face.c
===================================================================
--- grass/branches/develbranch_6/vector/v.digit/i_face.c	2011-01-12 08:45:21 UTC (rev 44982)
+++ grass/branches/develbranch_6/vector/v.digit/i_face.c	2011-01-12 10:23:01 UTC (rev 44983)
@@ -79,6 +79,7 @@
 {
     int i;
     char val[1000];
+    char temp[1000];
 
     G_debug(4, "i_new_line_options(), create = %d", create);
 
@@ -88,9 +89,10 @@
 	/* Set cat mode */
 	sprintf(val, "$GWidget(cat_mode) configure -values [list");
 	for (i = 0; i < CAT_MODE_COUNT; i++) {
-	    sprintf(val, "%s \"%s\"", val, CatModeLab[i]);
+	    sprintf(temp, " \"%s\"", CatModeLab[i]);
+	    strcat(val, temp);
 	}
-	sprintf(val, "%s]", val);
+	strcat(val, "]");
 
 	G_debug(2, "Cat modes: %s", val);
 	Tcl_Eval(Toolbox, val);



More information about the grass-commit mailing list