From ef9db1df804f636ba6403ccac7eb14f3d5e851c7 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 13 May 2004 06:38:39 +0000 Subject: [PATCH] DBFReadStringValue always used to workaround shapelib bug with int values. git-svn-id: http://svn.osgeo.org/postgis/trunk@546 b70326c6-7e19-0410-871a-916f4a2858ee --- loader/shp2pgsql.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/loader/shp2pgsql.c b/loader/shp2pgsql.c index 69f29c4bb..c8dba635f 100644 --- a/loader/shp2pgsql.c +++ b/loader/shp2pgsql.c @@ -12,6 +12,9 @@ * ********************************************************************** * $Log$ + * Revision 1.54 2004/05/13 06:38:39 strk + * DBFReadStringValue always used to workaround shapelib bug with int values. + * * Revision 1.53 2004/04/21 09:13:15 strk * Attribute names escaping mechanism added. You should now * be able to dump a shapefile equal to the one loaded. @@ -558,6 +561,9 @@ Insert_attributes(DBFHandle hDBFHandle, int row) switch (types[i]) { case FTString: + case FTInteger: + case FTDouble: + case FTLogical: if ( -1 == snprintf(val, 1024, "%s", DBFReadStringAttribute(hDBFHandle, row, i)) ) { @@ -565,15 +571,6 @@ Insert_attributes(DBFHandle hDBFHandle, int row) val[1023] = '\0'; } break; - case FTInteger: - sprintf(val, "%d", DBFReadIntegerAttribute(hDBFHandle, row, i)); - break; - case FTDouble: - sprintf(val, "%f", DBFReadDoubleAttribute(hDBFHandle, row, i)); - break; - case FTLogical: - sprintf(val, "%s", DBFReadLogicalAttribute(hDBFHandle, row, i)); - break; default: fprintf(stderr, "Error: field %d has invalid or unknown field type (%d)\n", -- 2.40.0