diff options
author | Stef Walter <stef@memberwebs.com> | 2006-01-26 09:54:31 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2006-01-26 09:54:31 +0000 |
commit | 1ded2732d4c290dbff64d8091def1f70b76f6282 (patch) | |
tree | 4aa4dfa403304e9ee59cce693263ca607b36502f /src/common/stringx.c | |
parent | 7fcead4473bc224bc8c6a66e2db3b3ee87f751d4 (diff) |
SNMP support coded in.
Diffstat (limited to 'src/common/stringx.c')
-rw-r--r-- | src/common/stringx.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/common/stringx.c b/src/common/stringx.c index 06e4879..89deb9b 100644 --- a/src/common/stringx.c +++ b/src/common/stringx.c @@ -108,3 +108,17 @@ int strtob(const char* str) return -1; } + +size_t +strlcpy(char *dst, const char *src, size_t len) +{ + size_t ret = strlen(dst); + + while (len > 1) { + *dst++ = *src++; + len--; + } + if (len > 0) + *dst = '\0'; + return (ret); +} |