From b2b110f1a377e92928118c4ccf921bbb2f69ced9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Thu, 29 Sep 2022 21:21:01 +0200 Subject: api: change type of argument remaining_calls in hook_timer callback from string to integer (in scripts) --- src/plugins/python/weechat-python-api.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/plugins/python/weechat-python-api.c') diff --git a/src/plugins/python/weechat-python-api.c b/src/plugins/python/weechat-python-api.c index e8585c368..c487e7d84 100644 --- a/src/plugins/python/weechat-python-api.c +++ b/src/plugins/python/weechat-python-api.c @@ -2243,7 +2243,7 @@ weechat_python_api_hook_timer_cb (const void *pointer, void *data, { struct t_plugin_script *script; void *func_argv[2]; - char str_remaining_calls[32], empty_arg[1] = { '\0' }; + char empty_arg[1] = { '\0' }; const char *ptr_function, *ptr_data; int *rc, ret; @@ -2252,16 +2252,13 @@ weechat_python_api_hook_timer_cb (const void *pointer, void *data, if (ptr_function && ptr_function[0]) { - snprintf (str_remaining_calls, sizeof (str_remaining_calls), - "%d", remaining_calls); - func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; - func_argv[1] = str_remaining_calls; + func_argv[1] = &remaining_calls; rc = (int *) weechat_python_exec (script, WEECHAT_SCRIPT_EXEC_INT, ptr_function, - "ss", func_argv); + "si", func_argv); if (!rc) ret = WEECHAT_RC_ERROR; -- cgit v1.2.3