fix strncat and wcsncat (double null termination)
[musl] / src / string / wcsncat.c
index b07abe4..9d61bbb 100644 (file)
@@ -4,7 +4,7 @@ wchar_t *wcsncat(wchar_t *d, const wchar_t *s, size_t n)
 {
        wchar_t *a = d;
        d += wcslen(d);
-       while (n && (*d++ = *s++)) n--;
+       while (n && *s) n--, *d++ = *s++;
        *d++ = 0;
        return a;
 }