summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/GCCLibraries/libc/string.c3
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) {