Chromium Code Reviews| Index: fusl/src/string/strlcat.c |
| diff --git a/fusl/src/string/strlcat.c b/fusl/src/string/strlcat.c |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ef81209e35efeb2ae18e50b4fd99d85ae2aaf924 |
| --- /dev/null |
| +++ b/fusl/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); |
| +} |