瀏覽代碼

v.random: check Vect_open_new()

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@52942 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 年之前
父節點
當前提交
c59f08b87b
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      vector/v.random/main.c

+ 2 - 1
vector/v.random/main.c

@@ -163,7 +163,8 @@ int main(int argc, char *argv[])
     }
 
     /* create new vector map */
-    Vect_open_new(&Out, output, flag.z->answer ? WITH_Z : WITHOUT_Z);
+    if (-1 == Vect_open_new(&Out, output, flag.z->answer ? WITH_Z : WITHOUT_Z))
+        G_fatal_error(_("Unable to create vector map <%s>"), output);
 
     /* Do we need to write random values into attribute table? */
     if (parm.zcol->answer) {