[GRASS-SVN] r52895 - grass/branches/releasebranch_6_4/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Aug 25 05:49:48 PDT 2012


Author: mmetz
Date: 2012-08-25 05:49:48 -0700 (Sat, 25 Aug 2012)
New Revision: 52895

Modified:
   grass/branches/releasebranch_6_4/lib/init/set_data.c
Log:
hamish: increase buffer sizes

Modified: grass/branches/releasebranch_6_4/lib/init/set_data.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/init/set_data.c	2012-08-25 12:34:55 UTC (rev 52894)
+++ grass/branches/releasebranch_6_4/lib/init/set_data.c	2012-08-25 12:49:48 UTC (rev 52895)
@@ -53,10 +53,10 @@
 int main(int argc, char *argv[])
 {
     char version[80];
-    char gisdbase[70];
-    char location_name[41];
-    char location[1024];
-    char mapset[41];
+    char gisdbase[GPATH_MAX];
+    char location_name[GMAPSET_MAX];
+    char location[GPATH_MAX + GMAPSET_MAX];
+    char mapset[GMAPSET_MAX];
     int line;
     int yes;
     struct Cell_head window;
@@ -112,7 +112,7 @@
 
 	line++;
 	V_line(line, "DATABASE:");
-	V_ques(gisdbase, 's', line++, 10, sizeof(gisdbase) - 1);
+	V_ques(gisdbase, 's', line++, 10, 70 - 1);
 
 	V_intrpt_ok();
 	if (!V_call())
@@ -126,7 +126,7 @@
 	}
 #ifdef __MINGW32__
 	if (*gisdbase == '/') {
-	    char tmp[200], *p;
+	    char tmp[GPATH_MAX], *p;
 
 	    sprintf(tmp, "%s", getenv("WD"));
 	    for (p = tmp + strlen(tmp); --p >= tmp && *p == '\\';) ;
@@ -144,7 +144,7 @@
 	if (*gisdbase != '/')
 #endif
 	{
-	    char temp[200];
+	    char temp[GPATH_MAX];
 
 	    fprintf(stderr, "DATABASE <%s> - must start with /\n", gisdbase);
 	    sprintf(temp, " '%s'", gisdbase);



More information about the grass-commit mailing list