From 86d414f5cae062b06998ec66b0696a47d4f6a0f0 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Mon, 25 May 2026 01:25:32 +0200 Subject: Prevent sanitizer warning in os.time(). Reported by Sergey Bronnikov. #1454 --- src/lib_os.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib_os.c b/src/lib_os.c index 1dd45e549..60b7b82d6 100644 --- a/src/lib_os.c +++ b/src/lib_os.c @@ -234,8 +234,8 @@ LJLIB_CF(os_time) ts.tm_min = getfield(L, "min", 0); ts.tm_hour = getfield(L, "hour", 12); ts.tm_mday = getfield(L, "day", -1); - ts.tm_mon = getfield(L, "month", -1) - 1; - ts.tm_year = getfield(L, "year", -1) - 1900; + ts.tm_mon = (int)((unsigned int)getfield(L, "month", -1) - 1u); + ts.tm_year = (int)((unsigned int)getfield(L, "year", -1) - 1900u); ts.tm_isdst = getboolfield(L, "isdst"); t = mktime(&ts); } -- cgit v1.2.3-55-g6feb