diff options
-rw-r--r-- | src/common/plugin.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/common/plugin.c b/src/common/plugin.c index 56626865..d1493ccd 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -1735,6 +1735,7 @@ int xchat_set_plugin_pref_int (xchat_plugin *pl, char *var, int value) { char buffer[12]; + sprintf (buffer, "%d", value); return xchat_set_plugin_pref_str (pl, var, buffer); } @@ -1743,6 +1744,13 @@ int xchat_get_plugin_pref_int (xchat_plugin *pl, char *var) { char buffer[12]; - xchat_get_plugin_pref_str (pl, var, buffer); - return atoi (buffer); + + if (xchat_get_plugin_pref_str (pl, var, buffer)) + { + return atoi (buffer); + } + else + { + return -1; + } } |