X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fportab%2Fstrdup.c;h=adb19e7aa222b1ed9c38912f037fb6fab02d7fcf;hp=e735157043084d633e84ff7a9b578bca4e832a12;hb=7e14bd3b58522ac34f0af29182248df1577d99c9;hpb=8b17579e608f60bb48094756107c7e500499ac5f diff --git a/src/portab/strdup.c b/src/portab/strdup.c index e7351570..adb19e7a 100644 --- a/src/portab/strdup.c +++ b/src/portab/strdup.c @@ -1,35 +1,34 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * - * strdup() implementation. Public domain. - * - * $Id: strdup.c,v 1.1 2005/04/16 09:20:53 fw Exp $ */ #include "portab.h" -#include "imp.h" +/** + * @file + * strdup() implementation. Public domain. + */ + +#ifndef HAVE_STRDUP + #include #include #include -#include "exp.h" - -#ifndef HAVE_STRDUP - GLOBAL char * -strdup( const char *s ) +strdup(const char *s) { - char *dup; - size_t len = strlen( s ); - size_t alloc = len + 1; + char *dup; + size_t len = strlen(s); + size_t alloc = len + 1; - if (len >= alloc ) return NULL; - dup = malloc( alloc ); - if (dup) strlcpy(dup, s, alloc ); + if (len >= alloc) + return NULL; + dup = malloc(alloc); + if (dup) + strlcpy(dup, s, alloc ); -return dup; + return dup; } #endif -