diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2012-05-01 09:17:13 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2012-05-01 09:17:13 +0200 |
commit | d282d9fd0667758ac2cd655c821d92b8720ed49a (patch) | |
tree | e5be04e349b7c1b6c50dc180e5467ebcbb68a909 /src/plugins/scripts/tcl/weechat-tcl-api.c | |
parent | f4a07da0a27f292f176295be424a0969bdc02725 (diff) | |
download | weechat-d282d9fd0667758ac2cd655c821d92b8720ed49a.zip |
scripts: fix type of argument "rc" in callback of hook_process (from string to integer)
Diffstat (limited to 'src/plugins/scripts/tcl/weechat-tcl-api.c')
-rw-r--r-- | src/plugins/scripts/tcl/weechat-tcl-api.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/plugins/scripts/tcl/weechat-tcl-api.c b/src/plugins/scripts/tcl/weechat-tcl-api.c index 682437932..c282242e4 100644 --- a/src/plugins/scripts/tcl/weechat-tcl-api.c +++ b/src/plugins/scripts/tcl/weechat-tcl-api.c @@ -2869,25 +2869,23 @@ weechat_tcl_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_tcl_exec (script_callback->script, WEECHAT_SCRIPT_EXEC_INT, script_callback->function, - "sssss", func_argv); + "ssiss", func_argv); if (!rc) ret = WEECHAT_RC_ERROR; |