[GRASS-SVN] r31550 - grass/trunk/raster/r.li/r.li.daemon

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 28 09:32:42 EDT 2008


Author: neteler
Date: 2008-05-28 09:32:42 -0400 (Wed, 28 May 2008)
New Revision: 31550

Modified:
   grass/trunk/raster/r.li/r.li.daemon/daemon.c
   grass/trunk/raster/r.li/r.li.daemon/ipc.h
Log:
don't hardcode G*_MAX buffer lengths

Modified: grass/trunk/raster/r.li/r.li.daemon/daemon.c
===================================================================
--- grass/trunk/raster/r.li/r.li.daemon/daemon.c	2008-05-28 13:31:55 UTC (rev 31549)
+++ grass/trunk/raster/r.li/r.li.daemon/daemon.c	2008-05-28 13:32:42 UTC (rev 31550)
@@ -37,7 +37,7 @@
 int calculateIndex(char *file, int f(int, char **, area_des, double *),\
  char** parameters, char *raster, char *output){
 	
-	char pathSetup[150],out[150], parsed;
+	char pathSetup[GPATH_MAX],out[GPATH_MAX], parsed;
 	char * reportChannelName, * random_access_name;
 	struct History history;
 	g_areas g;
@@ -272,7 +272,7 @@
 int parseSetup(char *path, list l, g_areas g, char *raster){
 	struct stat s;
 	struct Cell_head cellhd;
-	char * buf, *token, *mapset;/* g_region[350]; */
+	char * buf, *token, *mapset;
 	int setup;
 	int letti;
 	double rel_x, rel_y, rel_rl, rel_cl;
@@ -368,7 +368,7 @@
 	else if (strcmp("MASKEDSAMPLEAREA", token) == 0){
 		double rel_sa_x, rel_sa_y, rel_sa_rl, rel_sa_cl;
 		int aid = 1;
-		char maskname[150];
+		char maskname[GNAME_MAX];
 		do{
 			rel_sa_x = atof(strtok(NULL, "|"));
 			rel_sa_y = atof(strtok(NULL, "|"));
@@ -413,7 +413,7 @@
 	else if (strcmp("MASKEDOVERLAYAREA", token) == 0){
 		double sa_n, sa_s, sa_w, sa_e;
 		int aid = 1;
-		char maskname[150];
+		char maskname[GNAME_MAX];
 		msg m;
 		do {
 			strcpy(maskname, strtok(NULL,"|"));

Modified: grass/trunk/raster/r.li/r.li.daemon/ipc.h
===================================================================
--- grass/trunk/raster/r.li/r.li.daemon/ipc.h	2008-05-28 13:31:55 UTC (rev 31549)
+++ grass/trunk/raster/r.li/r.li.daemon/ipc.h	2008-05-28 13:32:42 UTC (rev 31550)
@@ -53,7 +53,7 @@
 	int y;
 	int rl;
 	int cl;
-	char mask[150];
+	char mask[GNAME_MAX];
 } fields_maskedarea ;
 
 /**



More information about the grass-commit mailing list