diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-02-19 16:32:59 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-02-19 16:32:59 +0100 |
commit | 7f8e5b892d697f858d84b12b84b26979ac264f10 (patch) | |
tree | cf7ed8389372db00e85e76ec4330f6c02cdea52e /src/core | |
parent | e0db08c7826a3be58c5e396e6e20d282859142cf (diff) | |
download | weechat-7f8e5b892d697f858d84b12b84b26979ac264f10.zip |
core: call strdup in string_strndup if bytes equals strlen of string
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/wee-string.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/wee-string.c b/src/core/wee-string.c index f0566bf2f..f514f55f0 100644 --- a/src/core/wee-string.c +++ b/src/core/wee-string.c @@ -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); |