[GRASS-SVN] r59743 - grass/branches/develbranch_6/raster/r.li/r.li.daemon

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Apr 16 04:57:14 PDT 2014


Author: neteler
Date: 2014-04-16 04:57:14 -0700 (Wed, 16 Apr 2014)
New Revision: 59743

Modified:
   grass/branches/develbranch_6/raster/r.li/r.li.daemon/worker.c
Log:
r.li: crash less miserably if input map not found; removed unused vars

Modified: grass/branches/develbranch_6/raster/r.li/r.li.daemon/worker.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.daemon/worker.c	2014-04-16 11:56:59 UTC (rev 59742)
+++ grass/branches/develbranch_6/raster/r.li/r.li.daemon/worker.c	2014-04-16 11:57:14 UTC (rev 59743)
@@ -64,7 +64,8 @@
     func = f;
 
     /* open raster map */
-    mapset = G_find_cell(raster, "");
+    if (!(mapset = G_find_cell(raster, "")))
+        G_fatal_error(_("Raster map <%s> not found"), raster);
     fd = G_open_cell_old(raster, mapset);
     if (fd < 0)
 	    G_fatal_error(_("Cannot open raster map <%s>"), raster);
@@ -223,8 +224,7 @@
 char *mask_preprocessing(char *mask, char *raster, struct area_entry *ad)
 {
     const char *tmp_file;
-    char *mapset, *mask_mapset;
-    struct Cell_head cell, oldcell;
+    char *mask_mapset;
     int mask_fd, old_fd, *buf, i, j;
     CELL *old;
 



More information about the grass-commit mailing list