We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1bb755f commit 9fb7924Copy full SHA for 9fb7924
libc/src/time/time_utils.cpp
@@ -102,10 +102,10 @@ cpp::optional<time_t> mktime_internal(const tm *tm_out) {
102
103
// TODO: https://github.com/llvm/llvm-project/issues/121962
104
// Need to handle timezone and update of tm_isdst.
105
- time_t seconds = tm_out->tm_sec +
106
- tm_out->tm_min * time_constants::SECONDS_PER_MIN +
107
- tm_out->tm_hour * time_constants::SECONDS_PER_HOUR +
108
- total_days * time_constants::SECONDS_PER_DAY;
+ time_t seconds = static_cast<time_t>(
+ tm_out->tm_sec + tm_out->tm_min * time_constants::SECONDS_PER_MIN +
+ tm_out->tm_hour * time_constants::SECONDS_PER_HOUR +
+ total_days * time_constants::SECONDS_PER_DAY);
109
return seconds;
110
}
111
0 commit comments