From 1ded2732d4c290dbff64d8091def1f70b76f6282 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Thu, 26 Jan 2006 09:54:31 +0000 Subject: SNMP support coded in. --- src/common/stringx.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/common/stringx.c') 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); +} -- cgit v1.2.3