summaryrefslogtreecommitdiffstats
path: root/osdep/strlcat.c
diff options
context:
space:
mode:
Diffstat (limited to 'osdep/strlcat.c')
-rw-r--r--osdep/strlcat.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/osdep/strlcat.c b/osdep/strlcat.c
new file mode 100644
index 0000000000..1facc3333d
--- /dev/null
+++ b/osdep/strlcat.c
@@ -0,0 +1,15 @@
+/* strlcat implementation for systems that do not have it in libc
+ * Time-stamp: <2004-03-14 njk>
+ * (C) 2003-2004 Nicholas J. Kain <njk@aerifal.cx>
+ */
+
+#include "config.h"
+
+unsigned int strlcat (char *dest, const char *src, unsigned int size)
+{
+ register char *d = dest;
+
+ for (; size > 0 && *d != '\0'; size--, d++);
+ return (d - dest) + strlcpy(d, src, size);
+}
+