1
0
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:
Sébastien Helleu
2022-02-19 16:32:59 +01:00
parent e0db08c782
commit 7f8e5b892d
+1 -1
View File
@@ -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);