summaryrefslogtreecommitdiff
path: root/src/string/strncat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/string/strncat.c')
-rw-r--r--src/string/strncat.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/string/strncat.c b/src/string/strncat.c
new file mode 100644
index 00000000..255b7a72
--- /dev/null
+++ b/src/string/strncat.c
@@ -0,0 +1,10 @@
+#include <string.h>
+
+char *strncat(char *d, const char *s, size_t n)
+{
+ char *a = d;
+ d += strlen(d);
+ while (n && (*d++ = *s++)) n--;
+ *d++ = 0;
+ return a;
+}