diff options
Diffstat (limited to 'lib/libc/string/wcscpy.c')
-rw-r--r-- | lib/libc/string/wcscpy.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/libc/string/wcscpy.c b/lib/libc/string/wcscpy.c index 5777963..180bbd1 100644 --- a/lib/libc/string/wcscpy.c +++ b/lib/libc/string/wcscpy.c @@ -41,15 +41,11 @@ wcscpy(s1, s2) wchar_t * __restrict s1; const wchar_t * __restrict s2; { - wchar_t *p; - const wchar_t *q; + wchar_t *cp; - *s1 = '\0'; - p = s1; - q = s2; - while (*q) - *p++ = *q++; - *p = '\0'; + cp = s1; + while ((*cp++ = *s2++) != L'\0') + ; - return s1; + return (s1); } |