summaryrefslogtreecommitdiff
path: root/src/plugins/aspell
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-01-21 19:30:08 +0100
committerSebastien Helleu <flashcode@flashtux.org>2011-01-21 19:30:08 +0100
commitcc6bb607e09101df7769cf1ec46a9bf8a605dab0 (patch)
tree77eace769bf610fcce06ef8abe46264c92bfab4e /src/plugins/aspell
parent1ca2261e95b3f9b9dee59df5ee8fad5e8d493873 (diff)
downloadweechat-cc6bb607e09101df7769cf1ec46a9bf8a605dab0.zip
Test return value of calls to sscanf function
Diffstat (limited to 'src/plugins/aspell')
-rw-r--r--src/plugins/aspell/weechat-aspell.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/aspell/weechat-aspell.c b/src/plugins/aspell/weechat-aspell.c
index 498ac1183..698657293 100644
--- a/src/plugins/aspell/weechat-aspell.c
+++ b/src/plugins/aspell/weechat-aspell.c
@@ -676,7 +676,7 @@ weechat_aspell_modifier_cb (void *data, const char *modifier,
const char *color_normal, *color_error;
int utf8_char_int, char_size;
int length, index_result, length_word, word_ok;
- int length_color_normal, length_color_error;
+ int length_color_normal, length_color_error, rc;
/* make C compiler happy */
(void) data;
@@ -685,7 +685,10 @@ weechat_aspell_modifier_cb (void *data, const char *modifier,
if (!string || !string[0])
return NULL;
- sscanf (modifier_data, "%lx", &value);
+ rc = sscanf (modifier_data, "%lx", &value);
+ if ((rc == EOF) || (rc == 0))
+ return NULL;
+
buffer = (struct t_gui_buffer *)value;
if (!weechat_aspell_spellers)