mirror of
https://github.com/weechat/weechat.git
synced 2026-06-24 20:06:38 +02:00
python: use function util_parse_int in API function hook_signal_send
This commit is contained in:
@@ -3120,7 +3120,7 @@ API_FUNC(hook_signal)
|
||||
|
||||
API_FUNC(hook_signal_send)
|
||||
{
|
||||
char *signal, *type_data, *signal_data, *error;
|
||||
char *signal, *type_data, *signal_data;
|
||||
int number, rc;
|
||||
|
||||
API_INIT_FUNC(1, "hook_signal_send", API_RETURN_INT(WEECHAT_RC_ERROR));
|
||||
@@ -3137,9 +3137,7 @@ API_FUNC(hook_signal_send)
|
||||
}
|
||||
else if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_INT) == 0)
|
||||
{
|
||||
error = NULL;
|
||||
number = (int)strtol (signal_data, &error, 10);
|
||||
if (error && !error[0])
|
||||
if (weechat_util_parse_int (signal_data, 10, &number))
|
||||
rc = weechat_hook_signal_send (signal, type_data, &number);
|
||||
else
|
||||
rc = WEECHAT_RC_ERROR;
|
||||
|
||||
Reference in New Issue
Block a user