mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 03:30:14 +01:00
unix/modtime: Add type casting for mktime return value.
This adds type casting to avoid build errors on certain systems. Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This commit is contained in:
committed by
Damien George
parent
2b5669d193
commit
4f2f520dc2
@@ -189,7 +189,7 @@ static mp_obj_t mod_time_mktime(mp_obj_t tuple) {
|
||||
time.tm_isdst = -1; // auto-detect
|
||||
}
|
||||
time_t ret = mktime(&time);
|
||||
if (ret == -1) {
|
||||
if (ret == (time_t)-1) {
|
||||
mp_raise_msg(&mp_type_OverflowError, MP_ERROR_TEXT("invalid mktime usage"));
|
||||
}
|
||||
return timeutils_obj_from_timestamp(ret);
|
||||
|
||||
Reference in New Issue
Block a user