Alexander Barton : strdup.c: Code cleanup
Module: ngircd.git Branch: master Commit: 51396f8f1c10506b558ce98aafb80aff4b2a95bd URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=51396f8f1... Author: Alexander Barton <alex@barton.de> Date: Sun Mar 16 22:59:03 2014 +0100 strdup.c: Code cleanup --- src/portab/strdup.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/portab/strdup.c b/src/portab/strdup.c index 7c0ee8f..795af72 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 -
Teilnehmer (1)
- 
                
alex@arthur.barton.de