mirror of
https://github.com/weechat/weechat.git
synced 2026-06-28 13:56:37 +02:00
spell: fix refresh of bar item "spell_suggest" when the input becomes empty (issue #1586)
When the input is empty, length of string is zero: when sending zero to function weechat_string_dyn_alloc, the function returns NULL and therefore we return immediately instead of handling the empty input, which is a valid value. The regression was introduced by the use of dynamic strings, commit:299f74bfef(cherry picked from commiteb90a73fe8)
This commit is contained in:
@@ -20,6 +20,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
|
||||
|
||||
Bug fixes::
|
||||
|
||||
* spell: fix refresh of bar item "spell_suggest" when the input becomes empty (issue #1586)
|
||||
* spell: fix crash with IRC color codes in command line (issue #1589)
|
||||
|
||||
[[v3.0]]
|
||||
|
||||
@@ -802,7 +802,7 @@ spell_modifier_cb (const void *pointer, void *data,
|
||||
color_error = weechat_color (weechat_config_string (spell_config_color_misspelled));
|
||||
|
||||
length = strlen (string);
|
||||
result = weechat_string_dyn_alloc (length * 2);
|
||||
result = weechat_string_dyn_alloc ((length * 2) + 1);
|
||||
if (!result)
|
||||
return NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user