From bfef8da84c685dea678c8aa2fcb6d5a570d7a7b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 13 Aug 2017 10:40:01 +0200 Subject: api: change type of arguments status/gnutls_rc/sock in hook_connect() callback from string to integer (in scripts) --- src/plugins/tcl/weechat-tcl-api.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/plugins/tcl') 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; -- cgit v1.2.3