[GRASS-SVN] r71809 - grass/trunk/raster/r.fill.dir

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Nov 23 15:48:54 PST 2017


Author: wenzeslaus
Date: 2017-11-23 15:48:54 -0800 (Thu, 23 Nov 2017)
New Revision: 71809

Modified:
   grass/trunk/raster/r.fill.dir/main.c
Log:
r.fill.dir: if you don't know the answer, return null, not seemingly random internal value

Modified: grass/trunk/raster/r.fill.dir/main.c
===================================================================
--- grass/trunk/raster/r.fill.dir/main.c	2017-11-23 21:53:56 UTC (rev 71808)
+++ grass/trunk/raster/r.fill.dir/main.c	2017-11-23 23:48:54 UTC (rev 71809)
@@ -303,8 +303,10 @@
 	    return (7);
 	else if (dir == 64)
 	    return (8);
-	else
+	else {
+	    Rast_set_c_null_value(&dir, 1);
 	    return (dir);
+	}
     }
 
     else if (type == 2) {	/* ANSWERS aspect format */
@@ -324,8 +326,10 @@
 	    return (180);
 	else if (dir == 64)
 	    return (135);
-	else
+	else {
+	    Rast_set_c_null_value(&dir, 1);
 	    return (dir);
+	}
     }
 
     else {			/* [new] GRASS aspect format */
@@ -345,8 +349,10 @@
 	    return (180);
 	else if (dir == 64)
 	    return (135);
-	else
+	else {
+	    Rast_set_c_null_value(&dir, 1);
 	    return (dir);
+	}
     }
 
 }



More information about the grass-commit mailing list