diff options
author | Your Name <you@example.com> | 2020-06-24 03:13:32 +0200 |
---|---|---|
committer | Your Name <you@example.com> | 2020-06-24 03:13:32 +0200 |
commit | bbf207a76a108876d76edf8424e2abceb02e6d20 (patch) | |
tree | 885d8ce0b2266298bd5700e830d212eab293a9e3 | |
parent | TTY: Added better vga buff delete (diff) | |
download | pOS-bbf207a76a108876d76edf8424e2abceb02e6d20.tar.gz pOS-bbf207a76a108876d76edf8424e2abceb02e6d20.tar.bz2 pOS-bbf207a76a108876d76edf8424e2abceb02e6d20.zip |
stdlib: added strncat
-rw-r--r-- | src/pOS/arch/x86/libc/string/strncat.cpp | 7 | ||||
-rw-r--r-- | src/pOS/include/libc/string.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/pOS/arch/x86/libc/string/strncat.cpp b/src/pOS/arch/x86/libc/string/strncat.cpp new file mode 100644 index 0000000..7dd29cb --- /dev/null +++ b/src/pOS/arch/x86/libc/string/strncat.cpp @@ -0,0 +1,7 @@ +#include <string.h> + +char* strncat(char *dest, const char *src, size_t len) +{ + strncpy(dest + strlen(dest), src, len); + return dest; +} diff --git a/src/pOS/include/libc/string.h b/src/pOS/include/libc/string.h index 6983641..27b496c 100644 --- a/src/pOS/include/libc/string.h +++ b/src/pOS/include/libc/string.h @@ -8,5 +8,6 @@ size_t strlen(const char* str); void* memset(void* buf, int value, size_t size); void* memcpy(void* dst, const void* src, size_t size); char* strncpy(char* dst, const char* src, size_t len); +char* strncat(char *dest, const char *src, size_t len); #endif |