X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fencoding.c;h=6a1148a8dea48deaadb258a620aa285e56a8b263;hp=b54e787bd4cc10a5b671146dbad7661b5e9101bc;hb=5f3757249c17cb9e2826f645e0f8618534c80fcc;hpb=4659b601e187a5f2f1b150558822fea913b1769d diff --git a/src/encoding.c b/src/encoding.c index b54e787b..6a1148a8 100644 --- a/src/encoding.c +++ b/src/encoding.c @@ -561,9 +561,11 @@ cmp_utf16le_strings(const utf16lechar *s1, size_t n1, return (n1 < n2) ? -1 : 1; } -/* Duplicate a UTF16-LE string which may not be null-terminated. */ +/* Duplicate a UTF16-LE string. The input string might not be null terminated + * and might be misaligned, but the returned string is guaranteed to be null + * terminated and properly aligned. */ utf16lechar * -utf16le_dupz(const utf16lechar *ustr, size_t usize) +utf16le_dupz(const void *ustr, size_t usize) { utf16lechar *dup = MALLOC(usize + sizeof(utf16lechar)); if (dup) {