From 589a20d52666a8cdc4efc5914c2303437da13d28 Mon Sep 17 00:00:00 2001 From: Choe Hwanjin Date: Fri, 17 Nov 2006 20:36:40 +0900 Subject: =?UTF-8?q?=EB=A7=88=EC=A7=80=EB=A7=89=20=EA=B8=80=EC=9E=90?= =?UTF-8?q?=EB=A5=BC=20nul=EB=A1=9C=20=EC=B1=84=EC=9B=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://kldp.net/svn/hangul/libhangul/trunk@98 8f00fcd2-89fc-0310-932e-b01be5b65e01 --- test/hangul.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/hangul.c b/test/hangul.c index 37130fb..b44b76c 100644 --- a/test/hangul.c +++ b/test/hangul.c @@ -48,6 +48,11 @@ void ucs4_to_utf8(char *buf, const ucschar *ucs4, size_t bufsize) ret = iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); iconv_close(cd); + + if (outbytesleft > 0) + *outbuf = '\0'; + else + buf[bufsize - 1] = '\0'; } int -- cgit v1.2.1