From: John Tsiombikas Date: Tue, 7 Aug 2018 23:29:39 +0000 (+0300) Subject: strcpy X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=HEAD;p=retrocrawl strcpy --- diff --git a/src/amiga/libc/string.c b/src/amiga/libc/string.c index 9260cca..8fe50c4 100644 --- a/src/amiga/libc/string.c +++ b/src/amiga/libc/string.c @@ -45,6 +45,13 @@ void *memmove(void *dest, const void *src, size_t n) return dest; } +char *strcpy(char *dest, const char *src) +{ + char *res = dest; + while((*dest++ = *src++) != 0); + return res; +} + size_t strlen(const char *s) { size_t len = 0; diff --git a/src/amiga/libc/string.h b/src/amiga/libc/string.h index e1a1182..5ff0ba6 100644 --- a/src/amiga/libc/string.h +++ b/src/amiga/libc/string.h @@ -7,6 +7,8 @@ void memset(void *dest, int c, size_t n); void *memcpy(void *dest, const void *src, size_t n); void *memmove(void *dest, const void *src, size_t n); +char *strcpy(char *dest, const char *src); + size_t strlen(const char *s); char *strchr(const char *s, int c);