summaryrefslogtreecommitdiff
path: root/src/plugins/javascript/weechat-js-api.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/javascript/weechat-js-api.cpp')
-rw-r--r--src/plugins/javascript/weechat-js-api.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/plugins/javascript/weechat-js-api.cpp b/src/plugins/javascript/weechat-js-api.cpp
index c41c613f9..ab3b9a2ee 100644
--- a/src/plugins/javascript/weechat-js-api.cpp
+++ b/src/plugins/javascript/weechat-js-api.cpp
@@ -2309,7 +2309,6 @@ weechat_js_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;
@@ -2319,21 +2318,17 @@ weechat_js_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_js_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
ptr_function,
- "ssssss", func_argv);
+ "siiiss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;