Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions icu4c/source/tools/toolutil/toolutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ U_CAPI int32_t U_EXPORT2 getCurrentYear() {
if(currentYear == -1) {
time_t now = time(nullptr);
tm *fields = gmtime(&now);
if(fields==nullptr) {
fprintf(stderr, "error: gmtime() returned null\n");
exit(U_INTERNAL_PROGRAM_ERROR);
}
currentYear = 1900 + fields->tm_year;
}
return currentYear;
Expand Down