1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 19:23:13 +02:00

scripts: fix issue with year ≥ 2038 in function infolist_new_var_time

Affected plugins: python, lua, tcl, guile, javascript.
This commit is contained in:
Sébastien Helleu
2022-08-01 20:32:09 +02:00
parent 2475ba43a3
commit 1514570ff0
8 changed files with 22 additions and 16 deletions
+1 -1
View File
@@ -4413,7 +4413,7 @@ weechat_guile_api_infolist_new_var_time (SCM item, SCM name, SCM value)
result = API_PTR2STR(weechat_infolist_new_var_time (API_STR2PTR(API_SCM_TO_STRING(item)),
API_SCM_TO_STRING(name),
scm_to_int (value)));
(time_t)scm_to_long (value)));
API_RETURN_STRING(result);
}
+3 -3
View File
@@ -4305,10 +4305,10 @@ API_FUNC(infolist_new_var_pointer)
API_FUNC(infolist_new_var_time)
{
int value;
long value;
const char *result;
API_INIT_FUNC(1, "infolist_new_var_time", "ssi", API_RETURN_EMPTY);
API_INIT_FUNC(1, "infolist_new_var_time", "ssn", API_RETURN_EMPTY);
v8::String::Utf8Value item(args[0]);
v8::String::Utf8Value name(args[1]);
@@ -4318,7 +4318,7 @@ API_FUNC(infolist_new_var_time)
weechat_infolist_new_var_time (
(struct t_infolist_item *)API_STR2PTR(*item),
*name,
value));
(time_t)value));
API_RETURN_STRING(result);
}
+2 -2
View File
@@ -4658,7 +4658,7 @@ API_FUNC(infolist_new_var_time)
{
const char *item, *name;
const char *result;
int value;
long value;
API_INIT_FUNC(1, "infolist_new_var_time", API_RETURN_EMPTY);
if (lua_gettop (L) < 3)
@@ -4670,7 +4670,7 @@ API_FUNC(infolist_new_var_time)
result = API_PTR2STR(weechat_infolist_new_var_time (API_STR2PTR(item),
name,
value));
(time_t)value));
API_RETURN_STRING(result);
}
+1 -1
View File
@@ -4594,7 +4594,7 @@ API_FUNC(infolist_new_var_time)
result = API_PTR2STR(weechat_infolist_new_var_time (API_STR2PTR(item),
name,
SvIV (ST (2)))); /* value */
(time_t)SvIV (ST (2)))); /* value */
API_RETURN_STRING(result);
}
+3 -3
View File
@@ -4540,18 +4540,18 @@ API_FUNC(infolist_new_var_time)
{
char *item, *name;
const char *result;
int value;
long value;
API_INIT_FUNC(1, "infolist_new_var_time", API_RETURN_EMPTY);
item = NULL;
name = NULL;
value = 0;
if (!PyArg_ParseTuple (args, "ssi", &item, &name, &value))
if (!PyArg_ParseTuple (args, "ssl", &item, &name, &value))
API_WRONG_ARGS(API_RETURN_EMPTY);
result = API_PTR2STR(weechat_infolist_new_var_time (API_STR2PTR(item),
name,
value));
(time_t)value));
API_RETURN_STRING(result);
}
+4 -3
View File
@@ -4953,18 +4953,19 @@ API_FUNC(infolist_new_var_time)
{
Tcl_Obj *objp;
const char *result;
int i, value;
int i;
long value;
API_INIT_FUNC(1, "infolist_new_var_time", API_RETURN_EMPTY);
if (objc < 4)
API_WRONG_ARGS(API_RETURN_EMPTY);
if (Tcl_GetIntFromObj (interp, objv[3], &value) != TCL_OK)
if (Tcl_GetLongFromObj (interp, objv[3], &value) != TCL_OK)
API_WRONG_ARGS(API_RETURN_EMPTY);
result = API_PTR2STR(weechat_infolist_new_var_time (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i)), /* item */
Tcl_GetStringFromObj (objv[2], &i), /* name */
value));
(time_t)value));
API_RETURN_STRING(result);
}