mirror of
https://github.com/osmarks/ngircd.git
synced 2025-11-08 09:42:59 +00:00
strdup.c: Code cleanup
This commit is contained in:
@@ -25,12 +25,13 @@ strdup( const char *s )
|
||||
size_t len = strlen(s);
|
||||
size_t alloc = len + 1;
|
||||
|
||||
if (len >= alloc ) return NULL;
|
||||
if (len >= alloc)
|
||||
return NULL;
|
||||
dup = malloc(alloc);
|
||||
if (dup) strlcpy(dup, s, alloc );
|
||||
if (dup)
|
||||
strlcpy(dup, s, alloc );
|
||||
|
||||
return dup;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user