[GRASS-SVN] r37234 - grass/trunk/lib/gis
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu May 14 14:51:30 EDT 2009
Author: martinl
Date: 2009-05-14 14:51:30 -0400 (Thu, 14 May 2009)
New Revision: 37234
Modified:
grass/trunk/lib/gis/mapset_nme.c
Log:
rblazek: fix for QGIS crash
Modified: grass/trunk/lib/gis/mapset_nme.c
===================================================================
--- grass/trunk/lib/gis/mapset_nme.c 2009-05-14 10:39:36 UTC (rev 37233)
+++ grass/trunk/lib/gis/mapset_nme.c 2009-05-14 18:51:30 UTC (rev 37234)
@@ -140,13 +140,15 @@
char **G_available_mapsets(void)
{
char **mapsets = NULL;
- int alloc = 0;
+ int alloc = 50;
int n = 0;
DIR *dir;
struct dirent *ent;
G_debug(3, "G_available_mapsets");
+ mapsets = G_calloc(alloc, sizeof(char *));
+
dir = opendir(G_location_path());
if (!dir)
return mapsets;
@@ -170,6 +172,7 @@
}
mapsets[n++] = G_store(ent->d_name);
+ mapsets[n] = NULL;
}
closedir(dir);
More information about the grass-commit
mailing list