1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 01:03:14 +02:00

core: check that string is not NULL in function string_strndup

This commit is contained in:
Sébastien Helleu
2014-07-04 07:41:20 +02:00
parent 494d046594
commit e702722842
+3
View File
@@ -74,6 +74,9 @@ string_strndup (const char *string, int length)
{
char *result;
if (!string)
return NULL;
if ((int)strlen (string) < length)
return strdup (string);