summaryrefslogtreecommitdiff
path: root/src/plugins/python/weechat-python-api.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2022-09-29 21:21:01 +0200
committerSébastien Helleu <flashcode@flashtux.org>2022-09-29 21:21:01 +0200
commitb2b110f1a377e92928118c4ccf921bbb2f69ced9 (patch)
treee4c9ab1bfca964c58c94f2de58d5b414653504d3 /src/plugins/python/weechat-python-api.c
parent89400cbf7a9c3bc886fac7b5b3e596ff9b097e5d (diff)
downloadweechat-b2b110f1a377e92928118c4ccf921bbb2f69ced9.zip
api: change type of argument remaining_calls in hook_timer callback from string to integer (in scripts)
Diffstat (limited to 'src/plugins/python/weechat-python-api.c')
-rw-r--r--src/plugins/python/weechat-python-api.c9
1 files changed, 3 insertions, 6 deletions
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;