[GRASS-SVN] r54874 - grass/trunk/vector/v.in.ogr

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Feb 3 08:06:22 PST 2013


Author: mmetz
Date: 2013-02-03 08:06:21 -0800 (Sun, 03 Feb 2013)
New Revision: 54874

Modified:
   grass/trunk/vector/v.in.ogr/main.c
Log:
v.in.ogr: fix r54872 for linux

Modified: grass/trunk/vector/v.in.ogr/main.c
===================================================================
--- grass/trunk/vector/v.in.ogr/main.c	2013-02-03 16:01:44 UTC (rev 54873)
+++ grass/trunk/vector/v.in.ogr/main.c	2013-02-03 16:06:21 UTC (rev 54874)
@@ -334,19 +334,21 @@
 
     /* set up encoding for attribute data */
     if (param.encoding->answer) {
-	char *buf;
+	char *encbuf, *encp;
 	int len;
 	
 	len = strlen("SHAPE_ENCODING") + strlen(param.encoding->answer) + 2;
-	buf = G_malloc(len * sizeof(char));
+	encbuf = G_malloc(len * sizeof(char));
         /* -> Esri Shapefile */
-	sprintf(buf, "SHAPE_ENCODING=%s", param.encoding->answer);
-	putenv(buf);
+	sprintf(encbuf, "SHAPE_ENCODING=%s", param.encoding->answer);
+	encp = G_store(encbuf);
+	putenv(encp);
         /* -> DXF */
-	sprintf(buf, "DXF_ENCODING=%s", param.encoding->answer);
-	putenv(buf);
+	sprintf(encbuf, "DXF_ENCODING=%s", param.encoding->answer);
+	encp = G_store(encbuf);
+	putenv(encp);
         /* todo: others ? */
-	G_free(buf);
+	G_free(encbuf);
     }
 
     /* open OGR DSN */



More information about the grass-commit mailing list