summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChoe Hwanjin <choe.hwanjin@gmail.com>2006-11-17 20:36:40 +0900
committerChoe Hwanjin <choe.hwanjin@gmail.com>2006-11-17 20:36:40 +0900
commit589a20d52666a8cdc4efc5914c2303437da13d28 (patch)
treea2c0dad7a1cda6de6f4c3159c9a59ec2bca911e4 /test
parent2d7bd4d5442bdd9cf669587228931070715b5758 (diff)
downloadlibhangul-589a20d52666a8cdc4efc5914c2303437da13d28.tar.gz
마지막 글자를 nul로 채움
git-svn-id: http://kldp.net/svn/hangul/libhangul/trunk@98 8f00fcd2-89fc-0310-932e-b01be5b65e01
Diffstat (limited to 'test')
-rw-r--r--test/hangul.c5
1 files changed, 5 insertions, 0 deletions
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