From 19d65be597748df8c40298bd2ce8f70574958262 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Mon, 17 Jan 2005 09:21:13 +0000 Subject: [PATCH] Added one more bytes for terminating NULL in utf8 encoder git-svn-id: http://svn.osgeo.org/postgis/trunk@1307 b70326c6-7e19-0410-871a-916f4a2858ee --- loader/shp2pgsql.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/loader/shp2pgsql.c b/loader/shp2pgsql.c index 59b9236f7..71836b57f 100644 --- a/loader/shp2pgsql.c +++ b/loader/shp2pgsql.c @@ -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.