[GRASS-SVN] r55687 - grass/trunk/raster/r.watershed/front

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Apr 10 07:56:53 PDT 2013


Author: mmetz
Date: 2013-04-10 07:56:53 -0700 (Wed, 10 Apr 2013)
New Revision: 55687

Modified:
   grass/trunk/raster/r.watershed/front/main.c
Log:
r.watershed: check threshold option

Modified: grass/trunk/raster/r.watershed/front/main.c
===================================================================
--- grass/trunk/raster/r.watershed/front/main.c	2013-04-10 13:59:46 UTC (rev 55686)
+++ grass/trunk/raster/r.watershed/front/main.c	2013-04-10 14:56:53 UTC (rev 55687)
@@ -246,6 +246,12 @@
 	G_fatal_error(_("Sorry, you must choose an output map."));
     }
 
+    /* basin threshold */
+    if (opt6->answer) {
+	if (atoi(opt6->answer) <= 0)
+	    G_fatal_error(_("The basin threshold must be a positive number."));
+    }
+
     err = 0;
     /* basin and basin threshold */
     err += (opt10->answer != NULL && opt6->answer == NULL);



More information about the grass-commit mailing list