diff options
Diffstat (limited to 'ngircd/src/portab/strndup.c')
| -rw-r--r-- | ngircd/src/portab/strndup.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/ngircd/src/portab/strndup.c b/ngircd/src/portab/strndup.c deleted file mode 100644 index d63b972..0000000 --- a/ngircd/src/portab/strndup.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * ngIRCd -- The Next Generation IRC Daemon - */ - -#include "portab.h" - -/** - * @file - * strndup() implementation. Public domain. - */ - -#ifndef HAVE_STRNDUP - -#include <string.h> -#include <stdlib.h> -#include <sys/types.h> - -GLOBAL char * -strndup(const char *s, size_t maxlen) -{ - char *dup; - size_t len = strlen(s); - - if (len > maxlen) - len = maxlen; - len++; - dup = malloc(len); - if (dup) - strlcpy(dup, s, len); - - return dup; -} - -#endif |
