summaryrefslogtreecommitdiff
path: root/lib/libc/string/wcscpy.c
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2002-09-26 09:23:07 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2002-09-26 09:23:07 +0000
commite2361b6f168a9f8e07cfe495f856fa3d06a75d55 (patch)
treea7ca6c8771481c467a319cc23ece08990304ae79 /lib/libc/string/wcscpy.c
parent23b6f7902dab3d485f047b6b6cf1f5058484a8e3 (diff)
Notes
Diffstat (limited to 'lib/libc/string/wcscpy.c')
-rw-r--r--lib/libc/string/wcscpy.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/libc/string/wcscpy.c b/lib/libc/string/wcscpy.c
index 577796352daf..180bbd1b192d 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);
}