From e0a783a53821c55e4e55fde1f02bd6b83e1c05f4 Mon Sep 17 00:00:00 2001 From: tjr Date: Thu, 26 Sep 2002 09:23:07 +0000 Subject: Simplify by removing useless local variables and explicit null termination. --- lib/libc/string/wcscpy.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'lib/libc/string') 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); } -- cgit v1.1