Browse Source

Fix calculation of number of segments (round up instead of down)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@32239 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements 17 years ago
parent
commit
5641e863c4
1 changed files with 1 additions and 1 deletions
  1. 1 1
      raster/r.cost/main.c

+ 1 - 1
raster/r.cost/main.c

@@ -339,7 +339,7 @@ int main(int argc, char *argv[])
     srows = scols = SEGCOLSIZE;
     if (maxmem > 0)
 	segments_in_memory =
-	    2 + maxmem * (nrows / SEGCOLSIZE) * (ncols / SEGCOLSIZE) / 100;
+	    2 + maxmem * (1 + nrows / SEGCOLSIZE) * (1 + ncols / SEGCOLSIZE) / 100;
     else
 	segments_in_memory = 4 * (nrows / SEGCOLSIZE + ncols / SEGCOLSIZE + 2);