[GRASS-SVN] r56375 - grass/trunk/raster/r.random.cells

svn_grass at osgeo.org svn_grass at osgeo.org
Thu May 23 03:39:41 PDT 2013


Author: mmetz
Date: 2013-05-23 03:39:41 -0700 (Thu, 23 May 2013)
New Revision: 56375

Modified:
   grass/trunk/raster/r.random.cells/init.c
Log:
r.random.cells: add NULL value test

Modified: grass/trunk/raster/r.random.cells/init.c
===================================================================
--- grass/trunk/raster/r.random.cells/init.c	2013-05-23 10:23:56 UTC (rev 56374)
+++ grass/trunk/raster/r.random.cells/init.c	2013-05-23 10:39:41 UTC (rev 56375)
@@ -47,7 +47,7 @@
 	    for (row = 0; row < Rs; row++) {
 		Rast_get_c_row_nomask(FD, CellBuffer, row);
 		for (col = 0; col < Cs; col++) {
-		    if (CellBuffer[col]) {
+		    if (CellBuffer[col] && !Rast_is_c_null_value(&CellBuffer[col])) {
 			FLAG_SET(Cells, row, col);
 			CellCount++;
 		    }



More information about the grass-commit mailing list