summaryrefslogtreecommitdiff
path: root/src/plugins/spell
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2020-11-13 21:26:16 +0100
committerSébastien Helleu <flashcode@flashtux.org>2020-11-13 21:30:06 +0100
commiteb90a73fe811e2de0e0646abf10242e639a7b1a1 (patch)
tree0321a9367f92c4c8b21bc7fc5c97da78aecafb3a /src/plugins/spell
parent4065d32e685ad0db1c46dc245ed067d3786d3d09 (diff)
downloadweechat-eb90a73fe811e2de0e0646abf10242e639a7b1a1.zip
spell: fix refresh of bar item "spell_suggest" when the input becomes empty (closes #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: 299f74bfef9e0d239ad141a4df3b2dcf11a4c0da
Diffstat (limited to 'src/plugins/spell')
-rw-r--r--src/plugins/spell/spell.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/spell/spell.c b/src/plugins/spell/spell.c
index 62a88388c..e9278e995 100644
--- a/src/plugins/spell/spell.c
+++ b/src/plugins/spell/spell.c
@@ -801,7 +801,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;