1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

aspell: fix crash with command "/aspell addword" if no word is given (closes #164)

(cherry picked from commit 2629fd8c74)
This commit is contained in:
nils_2
2014-08-15 20:56:52 +02:00
committed by Sébastien Helleu
parent 52625d22da
commit addf755902
+5 -1
View File
@@ -441,9 +441,13 @@ weechat_aspell_command_cb (void *data, struct t_gui_buffer *buffer,
/* add word to personal dictionary */
if (weechat_strcasecmp (argv[1], "addword") == 0)
{
if (argc <= 2)
return WEECHAT_RC_ERROR;
if (argc > 3)
/* use a given dict */
weechat_aspell_command_add_word (buffer, argv[2], argv_eol[3]);
else
else if (argc > 2)
/* use default dict */
weechat_aspell_command_add_word (buffer, NULL, argv_eol[2]);
return WEECHAT_RC_OK;
}