]> granicus.if.org Git - postgis/commitdiff
DBFReadStringValue always used to workaround shapelib bug with int values.
authorSandro Santilli <strk@keybit.net>
Thu, 13 May 2004 06:38:39 +0000 (06:38 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 13 May 2004 06:38:39 +0000 (06:38 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@546 b70326c6-7e19-0410-871a-916f4a2858ee

loader/shp2pgsql.c

index 69f29c4bbc0c593ee4e220afe9bdcadb38eeeb1f..c8dba635fec7a87183847c20ee307444cb3000e2 100644 (file)
@@ -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",