diff options
author | Choe Hwanjin <choe.hwanjin@gmail.com> | 2006-11-17 20:36:40 +0900 |
---|---|---|
committer | Choe Hwanjin <choe.hwanjin@gmail.com> | 2006-11-17 20:36:40 +0900 |
commit | 589a20d52666a8cdc4efc5914c2303437da13d28 (patch) | |
tree | a2c0dad7a1cda6de6f4c3159c9a59ec2bca911e4 /test | |
parent | 2d7bd4d5442bdd9cf669587228931070715b5758 (diff) | |
download | libhangul-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.c | 5 |
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 |