From bbf207a76a108876d76edf8424e2abceb02e6d20 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 24 Jun 2020 03:13:32 +0200 Subject: stdlib: added strncat --- src/pOS/arch/x86/libc/string/strncat.cpp | 7 +++++++ src/pOS/include/libc/string.h | 1 + 2 files changed, 8 insertions(+) create mode 100644 src/pOS/arch/x86/libc/string/strncat.cpp (limited to 'src') 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 + +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 -- cgit 1.4.1