]> granicus.if.org Git - postgis/commitdiff
Added one more bytes for terminating NULL in utf8 encoder
authorSandro Santilli <strk@keybit.net>
Mon, 17 Jan 2005 09:21:13 +0000 (09:21 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 17 Jan 2005 09:21:13 +0000 (09:21 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@1307 b70326c6-7e19-0410-871a-916f4a2858ee

loader/shp2pgsql.c

index 59b9236f758fce8b8a34f63c99a3aae6f081a374..71836b57f4666ba1c736a1f585d84389dc5c6787 100644 (file)
@@ -1353,7 +1353,7 @@ utf8 (const char *fromcode, char *inputbuf)
                return NULL;
        }
 
-       outbytesleft = inbytesleft * 3; // UTF8 string can be 3 times larger
+       outbytesleft = inbytesleft*3+1; // UTF8 string can be 3 times larger
                                        // then local string
        outputbuf = (char *) malloc (outbytesleft);
        if (!outputbuf)
@@ -1379,6 +1379,9 @@ utf8 (const char *fromcode, char *inputbuf)
 
 /**********************************************************************
  * $Log$
+ * Revision 1.78  2005/01/17 09:21:13  strk
+ * Added one more bytes for terminating NULL in utf8 encoder
+ *
  * Revision 1.77  2005/01/16 16:50:01  strk
  * String escaping algorithm made simpler and more robust.
  * Removed escaped strings leaking.