[GRASS-SVN] r31979 -
grass/branches/releasebranch_6_3/vector/v.in.ascii
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jul 3 04:52:01 EDT 2008
Author: neteler
Date: 2008-07-03 04:52:01 -0400 (Thu, 03 Jul 2008)
New Revision: 31979
Modified:
grass/branches/releasebranch_6_3/vector/v.in.ascii/points.c
Log:
Enlarge buffers; better error messages (merge from trunk)
Modified: grass/branches/releasebranch_6_3/vector/v.in.ascii/points.c
===================================================================
--- grass/branches/releasebranch_6_3/vector/v.in.ascii/points.c 2008-07-03 08:20:32 UTC (rev 31978)
+++ grass/branches/releasebranch_6_3/vector/v.in.ascii/points.c 2008-07-03 08:52:01 UTC (rev 31979)
@@ -74,7 +74,7 @@
char *coorbuf, *tmp_token, *sav_buf;
int skip = FALSE, skipped = 0;
- buflen = 1000;
+ buflen = 4000;
buf = (char *)G_malloc(buflen);
buf_raw = (char *)G_malloc(buflen);
coorbuf = (char *)G_malloc(256);
@@ -158,8 +158,10 @@
skip = TRUE;
}
}
- else
- G_fatal_error(_("Unparsable longitude value: %s"), tokens[i]);
+ else {
+ fprintf(stderr, "Current row: '%s'\n", buf_raw);
+ G_fatal_error(_("Unparsable longitude value in column <%d>: %s"), i, tokens[i]);
+ }
}
if (i == ycol) {
@@ -173,8 +175,10 @@
skip = TRUE;
}
}
- else
- G_fatal_error(_("Unparsable latitude value: %s"), tokens[i]);
+ else {
+ fprintf(stderr, "Current row: '%s'\n", buf_raw);
+ G_fatal_error(_("Unparsable latitude value in column <%d>: %s"), i, tokens[i]);
+ }
}
} /* if (x or y) */
@@ -265,7 +269,7 @@
int *coltype, int xcol, int ycol, int zcol, int catcol,
int skip_lines)
{
- char *buf, buf2[1000];
+ char *buf, buf2[4000];
int cat = 0;
int row = 1;
struct line_pnts *Points;
More information about the grass-commit
mailing list