From 9f26cdeaec4b93ea50ed43572daecde8b7312a85 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 6 Jul 2001 17:43:05 +0000 Subject: Fix strxfrm, which was broken (thanks to Shaya Potter for noticing, and cleanup a warning. -Erik --- libc/string/string.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libc/string/string.c b/libc/string/string.c index 0a1ced8b3..4a367b561 100644 --- a/libc/string/string.c +++ b/libc/string/string.c @@ -63,8 +63,6 @@ char *strcpy(char *dst, const char *src) #ifdef L_stpcpy char *stpcpy(char *dst, const char *src) { - register char *ptr = dst; - while (*src) *dst++ = *src++; *dst = '\0'; @@ -164,7 +162,11 @@ char *strncpy(char *dst, const char *src, size_t len) #ifdef L_strxfrm size_t strxfrm(char *dst, const char *src, size_t len) { + size_t length; strncpy( dst, src, len); + length = strlen(src); + if (length