summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2002-09-26 09:28:55 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2002-09-26 09:28:55 +0000
commitce2a18008c9877654083a4f5b076d8b19a934bb0 (patch)
treeb4b51091d9e787c6f8cc63d55db76ccf12ddf722
parente2361b6f168a9f8e07cfe495f856fa3d06a75d55 (diff)
Notes
-rw-r--r--lib/libc/string/wcscat.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/libc/string/wcscat.c b/lib/libc/string/wcscat.c
index e12d8dfdf7c2..1c965335e4d2 100644
--- a/lib/libc/string/wcscat.c
+++ b/lib/libc/string/wcscat.c
@@ -41,17 +41,13 @@ wcscat(s1, s2)
wchar_t * __restrict s1;
const wchar_t * __restrict s2;
{
- wchar_t *p;
- wchar_t *q;
- const wchar_t *r;
+ wchar_t *cp;
- p = s1;
- while (*p)
- p++;
- q = p;
- r = s2;
- while (*r)
- *q++ = *r++;
- *q = '\0';
- return s1;
+ cp = s1;
+ while (*cp != L'\0')
+ cp++;
+ while ((*cp++ = *s2++) != L'\0')
+ ;
+
+ return (s1);
}