[GRASS-SVN] r57649 - grass/trunk/vector/v.in.ascii
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Sep 12 19:22:44 PDT 2013
Author: annakrat
Date: 2013-09-12 19:22:44 -0700 (Thu, 12 Sep 2013)
New Revision: 57649
Modified:
grass/trunk/vector/v.in.ascii/points.c
Log:
v.in.ascii: fix skip parameter, it required one line more (related to G_getl2 usage)
Modified: grass/trunk/vector/v.in.ascii/points.c
===================================================================
--- grass/trunk/vector/v.in.ascii/points.c 2013-09-12 20:36:16 UTC (rev 57648)
+++ grass/trunk/vector/v.in.ascii/points.c 2013-09-13 02:22:44 UTC (rev 57649)
@@ -298,7 +298,8 @@
Points = Vect_new_line_struct();
Cats = Vect_new_cats_struct();
- buf = (char *)G_malloc(rowlen + 1);
+ /* actually last 2 characters won't be read */
+ buf = (char *)G_malloc(rowlen + 2);
db_init_string(&sql);
db_init_string(&val);
@@ -307,7 +308,8 @@
Vect_hist_write(Map, buf2);
}
- while (G_getl2(buf, rowlen, ascii) != 0) {
+ /* rowlen + 2 to read till the end of line on both UNIX and Windows */
+ while (G_getl2(buf, rowlen + 2, ascii) != 0) {
int i, len;
double x, y, z;
char **tokens;
More information about the grass-commit
mailing list