From: Alexander Barton Date: Sun, 16 Mar 2014 21:59:03 +0000 (+0100) Subject: strdup.c: Code cleanup X-Git-Tag: rel-22-rc1~43 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=commitdiff_plain;h=51396f8f1c10506b558ce98aafb80aff4b2a95bd strdup.c: Code cleanup --- diff --git a/src/portab/strdup.c b/src/portab/strdup.c index 7c0ee8fd..795af726 100644 --- a/src/portab/strdup.c +++ b/src/portab/strdup.c @@ -19,18 +19,19 @@ #include "exp.h" 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 -