diff options
Diffstat (limited to 'runtime/GCCLibraries/libc/string.c')
-rw-r--r-- | runtime/GCCLibraries/libc/string.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/GCCLibraries/libc/string.c b/runtime/GCCLibraries/libc/string.c index c13b112..9cff5ec 100644 --- a/runtime/GCCLibraries/libc/string.c +++ b/runtime/GCCLibraries/libc/string.c @@ -35,6 +35,12 @@ char *strcpy(char *s1, const char *s2) { return dest; } +char *strncpy(char *s1, const char *s2, size_t n) { + char *dest = s1; + while (n-- && (*s1++ = *s2++)); + return dest; +} + char *strcat(char *s1, const char *s2) { strcpy(s1+strlen(s1), s2); return s1; |