summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornils_2 <weechatter@arcor.de>2014-08-15 20:56:52 +0200
committernils_2 <weechatter@arcor.de>2014-08-15 20:56:52 +0200
commit2629fd8c74f366fc61ebb953bfe03c744321860d (patch)
treecdc159defef6d3c33f5de7dcdc8d5c976d7d007e /src
parent1b7352e3797c7224941b27c87606859affc28b6d (diff)
downloadweechat-2629fd8c74f366fc61ebb953bfe03c744321860d.zip
aspell: fix crash with command "/aspell addword" if no word is given (closes #164)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/aspell/weechat-aspell-command.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/aspell/weechat-aspell-command.c b/src/plugins/aspell/weechat-aspell-command.c
index ccc5dc3c6..41d9e461e 100644
--- a/src/plugins/aspell/weechat-aspell-command.c
+++ b/src/plugins/aspell/weechat-aspell-command.c
@@ -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;
}