summaryrefslogtreecommitdiff
path: root/src/plugins/tcl
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-08-13 10:40:01 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-08-13 10:40:01 +0200
commitbfef8da84c685dea678c8aa2fcb6d5a570d7a7b2 (patch)
tree8c5064f94120fc7c5d700168c18bf00154c0b7ed /src/plugins/tcl
parentbf0df282a2a33ccc4179f5819b7936f37a0ebc37 (diff)
downloadweechat-bfef8da84c685dea678c8aa2fcb6d5a570d7a7b2.zip
api: change type of arguments status/gnutls_rc/sock in hook_connect() callback from string to integer (in scripts)
Diffstat (limited to 'src/plugins/tcl')
-rw-r--r--src/plugins/tcl/weechat-tcl-api.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/plugins/tcl/weechat-tcl-api.c b/src/plugins/tcl/weechat-tcl-api.c
index 90a21566d..28675b21e 100644
--- a/src/plugins/tcl/weechat-tcl-api.c
+++ b/src/plugins/tcl/weechat-tcl-api.c
@@ -2690,7 +2690,6 @@ weechat_tcl_api_hook_connect_cb (const void *pointer, void *data,
{
struct t_plugin_script *script;
void *func_argv[6];
- char str_status[32], str_gnutls_rc[32], str_sock[32];
char empty_arg[1] = { '\0' };
const char *ptr_function, *ptr_data;
int *rc, ret;
@@ -2700,21 +2699,17 @@ weechat_tcl_api_hook_connect_cb (const void *pointer, void *data,
if (ptr_function && ptr_function[0])
{
- snprintf (str_status, sizeof (str_status), "%d", status);
- snprintf (str_gnutls_rc, sizeof (str_gnutls_rc), "%d", gnutls_rc);
- snprintf (str_sock, sizeof (str_sock), "%d", sock);
-
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
- func_argv[1] = str_status;
- func_argv[2] = str_gnutls_rc;
- func_argv[3] = str_sock;
+ func_argv[1] = &status;
+ func_argv[2] = &gnutls_rc;
+ func_argv[3] = &sock;
func_argv[4] = (ip_address) ? (char *)ip_address : empty_arg;
func_argv[5] = (error) ? (char *)error : empty_arg;
rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
ptr_function,
- "ssssss", func_argv);
+ "siiiss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;