fix trailing whitespace issues that crept in here and there
[musl] / src / string / wcsncpy.c
index 0164208..4bede04 100644 (file)
@@ -1,9 +1,9 @@
 #include <wchar.h>
 
-wchar_t *wcsncpy(wchar_t *d, const wchar_t *s, size_t n)
+wchar_t *wcsncpy(wchar_t *restrict d, const wchar_t *restrict s, size_t n)
 {
        wchar_t *a = d;
-       while (n && (*d++ = *s++)) n--;
+       while (n && *s) n--, *d++ = *s++;
        wmemset(d, 0, n);
        return a;
 }