From 68172da05524b1b0d2234dd364205369f0859b5b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 21 Oct 2003 17:53:16 +0000 Subject: [PATCH] Fix strcpy implementation and trie git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9338 91177308-0d34-0410-b5e6-96231b3b80d8 --- runtime/GCCLibraries/libc/string.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/GCCLibraries/libc/string.c b/runtime/GCCLibraries/libc/string.c index bc262a5f4ce..0ed4ced64c4 100644 --- a/runtime/GCCLibraries/libc/string.c +++ b/runtime/GCCLibraries/libc/string.c @@ -23,8 +23,9 @@ char *strdup(const char *str) { } char *strcpy(char *s1, const char *s2) { + char *dest = s1; while ((*s1++ = *s2++)); - return s1; + return dest; } char *strcat(char *s1, const char *s2) {