commit | 13f7de10fd30086b6771328282aa995cfcc9b08f | [log] [tgz] |
---|---|---|
author | Thomas Klausner <tk@giga.or.at> | Sat Feb 18 00:05:26 2012 +0100 |
committer | Thomas Klausner <tk@giga.or.at> | Sat Feb 18 00:05:26 2012 +0100 |
tree | e0fad5710c18b41cbf90779630434aff0b6d000d | |
parent | 732414e1194a57809c63b78ec5f8f27ea9331303 [diff] [blame] |
NUL-terminate converted file name. --HG-- branch : HEAD
diff --git a/lib/zip_utf-8.c b/lib/zip_utf-8.c index c74b5eb..9b1f09e 100644 --- a/lib/zip_utf-8.c +++ b/lib/zip_utf-8.c
@@ -205,7 +205,7 @@ if (len == 0) return NULL; - buflen = 0; + buflen = 1; for (i=0; i<len; i++) buflen += _zip_unicode_to_utf8_len(_cp437_to_unicode[cp437buf[i]]); @@ -219,5 +219,6 @@ offset += _zip_unicode_to_utf8(_cp437_to_unicode[cp437buf[i]], utf8buf+offset); + utf8buf[buflen-1] = 0; return utf8buf; }