diff options
author | tjr <tjr@FreeBSD.org> | 2002-09-26 09:23:07 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-09-26 09:23:07 +0000 |
commit | e0a783a53821c55e4e55fde1f02bd6b83e1c05f4 (patch) | |
tree | a7ca6c8771481c467a319cc23ece08990304ae79 | |
parent | e9dc19237215f59529ac3c4dbd7dd60561743329 (diff) | |
download | FreeBSD-src-e0a783a53821c55e4e55fde1f02bd6b83e1c05f4.zip FreeBSD-src-e0a783a53821c55e4e55fde1f02bd6b83e1c05f4.tar.gz |
Simplify by removing useless local variables and explicit null termination.
-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); } |