summaryrefslogtreecommitdiffstats
path: root/lib/libc/string
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/string')
-rw-r--r--lib/libc/string/memccpy.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/string/memccpy.c b/lib/libc/string/memccpy.c
index 878e419..c457110 100644
--- a/lib/libc/string/memccpy.c
+++ b/lib/libc/string/memccpy.c
@@ -49,9 +49,10 @@ memccpy(t, f, c, n)
if (n) {
register unsigned char *tp = t;
register const unsigned char *fp = f;
+ register unsigned char uc = c;
do {
- if ((*tp++ = *fp++) == c)
- return (t);
+ if ((*tp++ = *fp++) == uc)
+ return (tp);
} while (--n != 0);
}
return (0);
OpenPOWER on IntegriCloud