diff options
| author | Mike Pall <mike> | 2026-05-25 01:25:32 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2026-05-25 01:25:32 +0200 |
| commit | 86d414f5cae062b06998ec66b0696a47d4f6a0f0 (patch) | |
| tree | 1b6f002bb78e1178ae5e5a80f9de093382c981c7 /src | |
| parent | e4c7d8b38040518d42599eef8ddb5e67aa967a9c (diff) | |
| download | luajit-86d414f5cae062b06998ec66b0696a47d4f6a0f0.tar.gz luajit-86d414f5cae062b06998ec66b0696a47d4f6a0f0.tar.bz2 luajit-86d414f5cae062b06998ec66b0696a47d4f6a0f0.zip | |
Prevent sanitizer warning in os.time().
Reported by Sergey Bronnikov. #1454
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib_os.c | 4 |
1 files changed, 2 insertions, 2 deletions
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) | |||
| 234 | ts.tm_min = getfield(L, "min", 0); | 234 | ts.tm_min = getfield(L, "min", 0); |
| 235 | ts.tm_hour = getfield(L, "hour", 12); | 235 | ts.tm_hour = getfield(L, "hour", 12); |
| 236 | ts.tm_mday = getfield(L, "day", -1); | 236 | ts.tm_mday = getfield(L, "day", -1); |
| 237 | ts.tm_mon = getfield(L, "month", -1) - 1; | 237 | ts.tm_mon = (int)((unsigned int)getfield(L, "month", -1) - 1u); |
| 238 | ts.tm_year = getfield(L, "year", -1) - 1900; | 238 | ts.tm_year = (int)((unsigned int)getfield(L, "year", -1) - 1900u); |
| 239 | ts.tm_isdst = getboolfield(L, "isdst"); | 239 | ts.tm_isdst = getboolfield(L, "isdst"); |
| 240 | t = mktime(&ts); | 240 | t = mktime(&ts); |
| 241 | } | 241 | } |
