diff options
author | Bruce Mitchener <bruce.mitchener@gmail.com> | 2013-12-01 21:42:26 +0700 |
---|---|---|
committer | Bruce Mitchener <bruce.mitchener@gmail.com> | 2014-01-13 17:59:15 +0700 |
commit | 4353f5df1e4bae2a3d579a5c205b800bcc2d8d39 (patch) | |
tree | fb503cf12bd89a7eb3dbbb06a8612cfe6c859c35 /system/lib/libc/musl/src/string/strlcat.c | |
parent | 5d078cbbd7d4319ed6a852e14bf3e45f58a99511 (diff) |
Missing string.h functionality.
Diffstat (limited to 'system/lib/libc/musl/src/string/strlcat.c')
-rw-r--r-- | system/lib/libc/musl/src/string/strlcat.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/system/lib/libc/musl/src/string/strlcat.c b/system/lib/libc/musl/src/string/strlcat.c new file mode 100644 index 00000000..ef81209e --- /dev/null +++ b/system/lib/libc/musl/src/string/strlcat.c @@ -0,0 +1,9 @@ +#define _BSD_SOURCE +#include <string.h> + +size_t strlcat(char *d, const char *s, size_t n) +{ + size_t l = strnlen(d, n); + if (l == n) return l + strlen(s); + return l + strlcpy(d+l, s, n-l); +} |