diff options
-rw-r--r-- | src/common/plugin.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/common/plugin.c b/src/common/plugin.c index 070b348b..4b45619d 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -1958,7 +1958,13 @@ hexchat_pluginpref_get_int (hexchat_plugin *pl, const char *var) if (hexchat_pluginpref_get_str_real (pl, var, buffer, sizeof(buffer))) { - return atoi (buffer); + int ret = atoi (buffer); + + /* 0 could be success or failure, who knows */ + if (ret == 0 && *buffer != '0') + return -1; + + return ret; } else { |