Skip to content

Commit 4f2f520

Browse files
yf13dpgeorge
authored andcommitted
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 <[email protected]>
1 parent 2b5669d commit 4f2f520

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ports/unix/modtime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ static mp_obj_t mod_time_mktime(mp_obj_t tuple) {
189189
time.tm_isdst = -1; // auto-detect
190190
}
191191
time_t ret = mktime(&time);
192-
if (ret == -1) {
192+
if (ret == (time_t)-1) {
193193
mp_raise_msg(&mp_type_OverflowError, MP_ERROR_TEXT("invalid mktime usage"));
194194
}
195195
return timeutils_obj_from_timestamp(ret);

0 commit comments

Comments
 (0)