[GRASS-SVN] r57317 - in grass/branches/develbranch_6: display/d.linegraph lib/gis lib/proj lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jul 29 01:47:02 PDT 2013


Author: hamish
Date: 2013-07-29 01:47:01 -0700 (Mon, 29 Jul 2013)
New Revision: 57317

Modified:
   grass/branches/develbranch_6/display/d.linegraph/linegraph.c
   grass/branches/develbranch_6/lib/gis/datum.c
   grass/branches/develbranch_6/lib/proj/get_proj.c
   grass/branches/develbranch_6/lib/vector/Vlib/hist.c
Log:
some fixes for 'error: format not a string literal and no format arguments (merge from trunk)

Modified: grass/branches/develbranch_6/display/d.linegraph/linegraph.c
===================================================================
--- grass/branches/develbranch_6/display/d.linegraph/linegraph.c	2013-07-29 08:35:43 UTC (rev 57316)
+++ grass/branches/develbranch_6/display/d.linegraph/linegraph.c	2013-07-29 08:47:01 UTC (rev 57317)
@@ -536,7 +536,7 @@
     R_text(xlabel);
 
     /* top label */
-    sprintf(xlabel, title[2]->answer);
+    sprintf(xlabel, "%s", title[2]->answer);
     text_height = (b - t) * TEXT_HEIGHT;
     text_width = (r - l) * TEXT_WIDTH * 2.0;
     R_text_size(text_width, text_height);

Modified: grass/branches/develbranch_6/lib/gis/datum.c
===================================================================
--- grass/branches/develbranch_6/lib/gis/datum.c	2013-07-29 08:35:43 UTC (rev 57316)
+++ grass/branches/develbranch_6/lib/gis/datum.c	2013-07-29 08:47:01 UTC (rev 57317)
@@ -110,12 +110,12 @@
     int returnval = -1;
 
     if (NULL != G_find_key_value("datum", projinfo)) {
-	sprintf(datumname, G_find_key_value("datum", projinfo));
+	sprintf(datumname, "%s", G_find_key_value("datum", projinfo));
 	returnval = 1;
     }
 
     if (G_find_key_value("datumparams", projinfo) != NULL) {
-	sprintf(params, G_find_key_value("datumparams", projinfo));
+	sprintf(params, "%s", G_find_key_value("datumparams", projinfo));
 	returnval = 2;
     }
     else if (G_find_key_value("nadgrids", projinfo) != NULL) {

Modified: grass/branches/develbranch_6/lib/proj/get_proj.c
===================================================================
--- grass/branches/develbranch_6/lib/proj/get_proj.c	2013-07-29 08:35:43 UTC (rev 57316)
+++ grass/branches/develbranch_6/lib/proj/get_proj.c	2013-07-29 08:47:01 UTC (rev 57317)
@@ -135,7 +135,7 @@
 	     * key needs to be passed on. */
 	}
 	else if (strcmp(in_proj_keys->value[i], "defined") == 0)
-	    sprintf(buffa, in_proj_keys->key[i]);
+	    sprintf(buffa, "%s", in_proj_keys->key[i]);
 
 	else
 	    sprintf(buffa, "%s=%s",
@@ -192,7 +192,7 @@
 
     /* If datum parameters are present in the PROJ_INFO keys, pass them on */
     if (GPJ__get_datum_params(in_proj_keys, &datum, &params) == 2) {
-	sprintf(buffa, params);
+	sprintf(buffa, "%s", params);
 	alloc_options(buffa);
 	G_free(params);
 
@@ -202,7 +202,7 @@
     else if (datum != NULL) {
 
 	if (GPJ_get_default_datum_params_by_name(datum, &params) > 0) {
-	    sprintf(buffa, params);
+	    sprintf(buffa, "%s", params);
 	    alloc_options(buffa);
 	    returnval = 2;
 	    G_free(params);
@@ -249,7 +249,7 @@
 
     nsize = strlen(buffa);
     opt_in[nopt1++] = (char *)G_malloc(nsize + 1);
-    sprintf(opt_in[nopt1 - 1], buffa);
+    sprintf(opt_in[nopt1 - 1], "%s", buffa);
     return;
 }
 
@@ -274,7 +274,7 @@
 	sprintf(buffa, "proj=latlong ellps=WGS84");
 	nsize = strlen(buffa);
 	opt_in[nopt] = (char *)G_malloc(nsize + 1);
-	sprintf(opt_in[nopt++], buffa);
+	sprintf(opt_in[nopt++], "%s", buffa);
     }
     else {
 	/* Parameters have been provided; parse through them but don't
@@ -306,14 +306,14 @@
 			if (strcmp(info->proj, "ll") == 0)
 			    sprintf(buffa, "proj=latlong");
 			else
-			    sprintf(buffa, s);
+			    sprintf(buffa, "%s", s);
 		    }
 		    else {
-			sprintf(buffa, s);
+			sprintf(buffa, "%s", s);
 		    }
 		    nsize = strlen(buffa);
 		    opt_in[nopt] = (char *)G_malloc(nsize + 1);
-		    sprintf(opt_in[nopt++], buffa);
+		    sprintf(opt_in[nopt++], "%s", buffa);
 		}
 	    }
 	    s = 0;

Modified: grass/branches/develbranch_6/lib/vector/Vlib/hist.c
===================================================================
--- grass/branches/develbranch_6/lib/vector/Vlib/hist.c	2013-07-29 08:35:43 UTC (rev 57316)
+++ grass/branches/develbranch_6/lib/vector/Vlib/hist.c	2013-07-29 08:47:01 UTC (rev 57317)
@@ -64,7 +64,7 @@
     int ret;
 
     G_debug(5, "Vect_hist_write()");
-    ret = fprintf(Map->hist_fp, str);
+    ret = fprintf(Map->hist_fp, "%s", str);
     fflush(Map->hist_fp);
 
     return (ret);



More information about the grass-commit mailing list