]> granicus.if.org Git - postgis/commitdiff
field type array allocates num_fields * sizeof(int) instead of sizeof(char*)
authorSandro Santilli <strk@keybit.net>
Thu, 15 Jan 2004 09:57:07 +0000 (09:57 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 15 Jan 2004 09:57:07 +0000 (09:57 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@426 b70326c6-7e19-0410-871a-916f4a2858ee

loader/shp2pgsql.c

index be321a8435d93686674f49ba005d9e186f9dba13..0b6f03a40c9a7ab773be0f5c30eed154d66cd71c 100644 (file)
@@ -12,6 +12,9 @@
  * 
  **********************************************************************
  * $Log$
+ * Revision 1.46  2004/01/15 09:57:07  strk
+ * field type array allocates num_fields * sizeof(int) instead of sizeof(char*)
+ *
  * Revision 1.45  2004/01/02 20:11:41  strk
  * always call setval with no schema specification. drop 'database' argument using the empty string to the AddGeometryColumn call
  *
@@ -704,7 +707,7 @@ int main (int ARGC, char **ARGV){
        num_fields = DBFGetFieldCount( hDBFHandle );
        num_records = DBFGetRecordCount(hDBFHandle);
        names = malloc(num_fields*sizeof(char*));
-       types = (DBFFieldType *)malloc(num_fields*sizeof(char*));
+       types = (DBFFieldType *)malloc(num_fields*sizeof(int));
        widths = malloc(num_fields*sizeof(int));
        precisions = malloc(num_fields*sizeof(int));
        col_names = malloc(num_fields * sizeof(char) * 32);