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; }