summaryrefslogtreecommitdiff
path: root/src/plugins/python
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2022-08-01 21:03:44 +0200
committerSébastien Helleu <flashcode@flashtux.org>2022-08-01 21:03:44 +0200
commitb1404b02777c58d5e104082f349dff201bd12ef8 (patch)
tree6b132f6dc587e49ae31bc9a5d773c8505cdef1af /src/plugins/python
parent1514570ff02967b40ad3f72e301a574ed49d29ab (diff)
downloadweechat-b1404b02777c58d5e104082f349dff201bd12ef8.zip
scripts: fix issue with year ≥ 2038 in functions print_date_tags and print_y_date_tags
Affected plugins: python, lua, tcl, guile, javascript.
Diffstat (limited to 'src/plugins/python')
-rw-r--r--src/plugins/python/weechat-python-api.c13
1 files changed, 7 insertions, 6 deletions
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);