about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYour Name <you@example.com>2020-06-24 03:13:32 +0200
committerYour Name <you@example.com>2020-06-24 03:13:32 +0200
commitbbf207a76a108876d76edf8424e2abceb02e6d20 (patch)
tree885d8ce0b2266298bd5700e830d212eab293a9e3
parentTTY: Added better vga buff delete (diff)
downloadpOS-bbf207a76a108876d76edf8424e2abceb02e6d20.tar.gz
pOS-bbf207a76a108876d76edf8424e2abceb02e6d20.tar.bz2
pOS-bbf207a76a108876d76edf8424e2abceb02e6d20.zip
stdlib: added strncat
-rw-r--r--src/pOS/arch/x86/libc/string/strncat.cpp7
-rw-r--r--src/pOS/include/libc/string.h1
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