]> wimlib.net Git - wimlib/blobdiff - src/util.c
Fix utf16le_strlen() and recursive error messages
[wimlib] / src / util.c
index eb0ea9af6f8ca2a3718d55c4201087a4b52db99a..3c682ce0d6b68971d95b4784e7175d6d12c84df5 100644 (file)
@@ -53,7 +53,7 @@ static size_t utf16le_strlen(const utf16lechar *s)
        const utf16lechar *p = s;
        while (*p)
                p++;
        const utf16lechar *p = s;
        while (*p)
                p++;
-       return (p - s) / sizeof(utf16lechar);
+       return (p - s) * sizeof(utf16lechar);
 }
 
 /* Handle %W for UTF16-LE printing and %U for UTF-8 printing.
 }
 
 /* Handle %W for UTF16-LE printing and %U for UTF-8 printing.