2 * ngIRCd -- The Next Generation IRC Daemon
4 * strdup() implementation. Public domain.
6 * $Id: strdup.c,v 1.1 2005/04/16 09:20:53 fw Exp $
14 #include <sys/types.h>
21 strdup( const char *s )
24 size_t len = strlen( s );
25 size_t alloc = len + 1;
27 if (len >= alloc ) return NULL;
28 dup = malloc( alloc );
29 if (dup) strlcpy(dup, s, alloc );