浏览代码

r.watershed: check threshold option

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@55687 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 12 年之前
父节点
当前提交
812f3d328d
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      raster/r.watershed/front/main.c

+ 6 - 0
raster/r.watershed/front/main.c

@@ -246,6 +246,12 @@ int main(int argc, char *argv[])
 	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);