diff options
| -rw-r--r-- | llvm/runtime/GCCLibraries/libc/string.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/runtime/GCCLibraries/libc/string.c b/llvm/runtime/GCCLibraries/libc/string.c index bc262a5f4ce..0ed4ced64c4 100644 --- a/llvm/runtime/GCCLibraries/libc/string.c +++ b/llvm/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) { |

