diff options
author | nils_2 <weechatter@arcor.de> | 2014-08-15 20:56:52 +0200 |
---|---|---|
committer | nils_2 <weechatter@arcor.de> | 2014-08-15 20:56:52 +0200 |
commit | 2629fd8c74f366fc61ebb953bfe03c744321860d (patch) | |
tree | cdc159defef6d3c33f5de7dcdc8d5c976d7d007e /src/plugins | |
parent | 1b7352e3797c7224941b27c87606859affc28b6d (diff) | |
download | weechat-2629fd8c74f366fc61ebb953bfe03c744321860d.zip |
aspell: fix crash with command "/aspell addword" if no word is given (closes #164)
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/aspell/weechat-aspell-command.c | 6 |
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; } |