[GRASS-SVN] r30694 - grass/trunk/display/d.vect
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Mar 22 15:18:26 EDT 2008
Author: martinl
Date: 2008-03-22 15:18:26 -0400 (Sat, 22 Mar 2008)
New Revision: 30694
Modified:
grass/trunk/display/d.vect/plot1.c
Log:
d.vect: avoid segfault when Points->n_points==0; use G_warning() instead of fprintf()
Modified: grass/trunk/display/d.vect/plot1.c
===================================================================
--- grass/trunk/display/d.vect/plot1.c 2008-03-22 14:50:12 UTC (rev 30693)
+++ grass/trunk/display/d.vect/plot1.c 2008-03-22 19:18:26 UTC (rev 30694)
@@ -282,7 +282,7 @@
switch ( ltype )
{
case -1:
- fprintf (stderr, _("\nERROR: vector map - can't read\n" ));
+ G_warning(_("Unable to read vector map"));
return -1;
case -2: /* EOF */
return 0;
@@ -291,6 +291,9 @@
if ( !(type & ltype) ) continue;
+ if ( Points->n_points == 0 )
+ continue;
+
if ( chcat ) {
int found = 0;
More information about the grass-commit
mailing list