[GRASS-SVN] r74314 - grass/trunk/general/g.proj

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 27 01:51:01 PDT 2019


Author: mmetz
Date: 2019-03-27 01:51:01 -0700 (Wed, 27 Mar 2019)
New Revision: 74314

Modified:
   grass/trunk/general/g.proj/list_codes.c
Log:
g.proj: use format with sprintf, fixes #3802

Modified: grass/trunk/general/g.proj/list_codes.c
===================================================================
--- grass/trunk/general/g.proj/list_codes.c	2019-03-27 00:29:44 UTC (rev 74313)
+++ grass/trunk/general/g.proj/list_codes.c	2019-03-27 08:51:01 UTC (rev 74314)
@@ -106,7 +106,7 @@
 	authname = "epsg";
 
     init_info = proj_init_info(authname);
-    sprintf(pathname, init_info.filename);
+    sprintf(pathname, "%s", init_info.filename);
     
     if (access(pathname, F_OK) != 0)
 	G_fatal_error(_("Unable to find init file %s"), authname);
@@ -163,7 +163,7 @@
 	 * definition follows code until next '<' */
 
 	if (*buf == '#' && buflen > 2) {
-	    sprintf(name, buf + 2);
+	    sprintf(name, "%s", buf + 2);
 	    continue;
 	}
 
@@ -192,7 +192,7 @@
 
 		if (j < buflen) {
 		    buf[j] = '\0';
-		    sprintf(code, buf + bufstart);
+		    sprintf(code, "%s", buf + bufstart);
 		}
 		i = j + 1;
 		bufstart = i;
@@ -203,7 +203,7 @@
 		/* the remaining content of the line could be the name */
 		bufstart = i + 1;
 		if (bufstart < buflen) {
-		    sprintf(name, buf + bufstart);
+		    sprintf(name, "%s", buf + bufstart);
 		    G_strip(name);
 		}
 		i = buflen;



More information about the grass-commit mailing list