diff options
Diffstat (limited to 'runtime/GCCLibraries/libc/string.c')
-rw-r--r-- | runtime/GCCLibraries/libc/string.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/GCCLibraries/libc/string.c b/runtime/GCCLibraries/libc/string.c index bc262a5f4c..0ed4ced64c 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) { |