diff options
author | Wojtek Kosior <kwojtus@protonmail.com> | 2019-12-31 17:28:49 +0100 |
---|---|---|
committer | Wojtek Kosior <kwojtus@protonmail.com> | 2019-12-31 17:28:49 +0100 |
commit | b77ef684b07bcd91c168b15f71611786dd5a3377 (patch) | |
tree | 43ddd56254da4940023638639053be74ecddbe69 | |
parent | d2d7ebbea19d55fb2a292ca766d95b197691b941 (diff) | |
download | rpi-MMU-example-b77ef684b07bcd91c168b15f71611786dd5a3377.tar.gz rpi-MMU-example-b77ef684b07bcd91c168b15f71611786dd5a3377.zip |
add strcat
-rw-r--r-- | strings.c | 15 | ||||
-rw-r--r-- | strings.h | 2 |
2 files changed, 17 insertions, 0 deletions
@@ -106,3 +106,18 @@ void *memset(void *s, int c, size_t n) return s; } +char *strcat(char *dst, const char *src) +{ + char *where_to_append; + + for (where_to_append = dst; *where_to_append; where_to_append++); + + size_t i; + + for (i = 0; src[i]; i++) + ((char volatile*) where_to_append)[i] = src[i]; + + ((char volatile*) where_to_append)[i] = '\0'; + + return dst; +} @@ -28,4 +28,6 @@ void memcpy(void *dst, void *src, size_t nbytes); void *memset(void *s, int c, size_t n); +char *strcat(char *dst, const char *src); + #endif // STRINGS_H |