Prevent overflow when calculating timezones (#3730)

This commit is contained in:
todd-herbert
2024-04-27 13:43:09 +12:00
committed by GitHub
parent 827bacdfc8
commit dfcabba0b2

View File

@@ -223,7 +223,7 @@ int32_t getTZOffset()
now = time(NULL); now = time(NULL);
gmt = gmtime(&now); gmt = gmtime(&now);
gmt->tm_isdst = -1; gmt->tm_isdst = -1;
return (int16_t)difftime(now, mktime(gmt)); return (int32_t)difftime(now, mktime(gmt));
} }
/** /**