From b1404b02777c58d5e104082f349dff201bd12ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Mon, 1 Aug 2022 21:03:44 +0200 Subject: =?UTF-8?q?scripts:=20fix=20issue=20with=20year=20=E2=89=A5=202038?= =?UTF-8?q?=20in=20functions=20print=5Fdate=5Ftags=20and=20print=5Fy=5Fdat?= =?UTF-8?q?e=5Ftags?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Affected plugins: python, lua, tcl, guile, javascript. --- src/plugins/python/weechat-python-api.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/plugins/python') diff --git a/src/plugins/python/weechat-python-api.c b/src/plugins/python/weechat-python-api.c index 2251a517b..cab0040dc 100644 --- a/src/plugins/python/weechat-python-api.c +++ b/src/plugins/python/weechat-python-api.c @@ -1889,20 +1889,20 @@ API_FUNC(prnt) API_FUNC(prnt_date_tags) { char *buffer, *tags, *message; - int date; + long date; API_INIT_FUNC(1, "prnt_date_tags", API_RETURN_ERROR); buffer = NULL; date = 0; tags = NULL; message = NULL; - if (!PyArg_ParseTuple (args, "siss", &buffer, &date, &tags, &message)) + if (!PyArg_ParseTuple (args, "slss", &buffer, &date, &tags, &message)) API_WRONG_ARGS(API_RETURN_ERROR); plugin_script_api_printf_date_tags (weechat_python_plugin, python_current_script, API_STR2PTR(buffer), - date, + (time_t)date, tags, "%s", message); @@ -1933,7 +1933,8 @@ API_FUNC(prnt_y) API_FUNC(prnt_y_date_tags) { char *buffer, *tags, *message; - int y, date; + int y; + long date; API_INIT_FUNC(1, "prnt_y_date_tags", API_RETURN_ERROR); buffer = NULL; @@ -1941,14 +1942,14 @@ API_FUNC(prnt_y_date_tags) date = 0; tags = NULL; message = NULL; - if (!PyArg_ParseTuple (args, "siiss", &buffer, &y, &date, &tags, &message)) + if (!PyArg_ParseTuple (args, "silss", &buffer, &y, &date, &tags, &message)) API_WRONG_ARGS(API_RETURN_ERROR); plugin_script_api_printf_y_date_tags (weechat_python_plugin, python_current_script, API_STR2PTR(buffer), y, - date, + (time_t)date, tags, "%s", message); -- cgit v1.2.3