mirror of
https://github.com/weechat/weechat.git
synced 2026-07-08 02:33:12 +02:00
core: call strdup in string_strndup if bytes equals strlen of string
This commit is contained in:
@@ -82,7 +82,7 @@ string_strndup (const char *string, int bytes)
|
||||
if (!string || (bytes < 0))
|
||||
return NULL;
|
||||
|
||||
if ((int)strlen (string) < bytes)
|
||||
if ((int)strlen (string) <= bytes)
|
||||
return strdup (string);
|
||||
|
||||
result = malloc (bytes + 1);
|
||||
|
||||
Reference in New Issue
Block a user