1
0
mirror of https://github.com/moparisthebest/hexchat synced 2024-11-29 20:52:16 -05:00

make error check possible for xchat_get_plugin_pref_int

This commit is contained in:
Berke Viktor 2011-11-30 08:52:55 +01:00
parent ac4043dd9d
commit e488a0232a

View File

@ -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;
}
}