1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-03 08:13:14 +02:00

scripts: fix type of argument "rc" in callback of hook_process (from string to integer)

This commit is contained in:
Sebastien Helleu
2012-05-01 09:17:13 +02:00
parent f4a07da0a2
commit d282d9fd06
8 changed files with 26 additions and 32 deletions
@@ -2361,25 +2361,23 @@ weechat_guile_api_hook_process_cb (void *data,
{
struct t_script_callback *script_callback;
void *func_argv[5];
char str_rc[32], empty_arg[1] = { '\0' };
char empty_arg[1] = { '\0' };
int *rc, ret;
script_callback = (struct t_script_callback *)data;
if (script_callback && script_callback->function && script_callback->function[0])
{
snprintf (str_rc, sizeof (str_rc), "%d", return_code);
func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
func_argv[1] = (command) ? (char *)command : empty_arg;
func_argv[2] = str_rc;
func_argv[2] = &return_code;
func_argv[3] = (out) ? (char *)out : empty_arg;
func_argv[4] = (err) ? (char *)err : empty_arg;
rc = (int *) weechat_guile_exec (script_callback->script,
WEECHAT_SCRIPT_EXEC_INT,
script_callback->function,
"sssss", func_argv);
"ssiss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;