ICU-23075 Add nullptr check for localtime call at writesrc.cpp

This commit is contained in:
Burkov Egor 2025-03-13 10:21:15 +03:00
parent 30e23b0d28
commit 2c6bac2f97

View file

@ -136,7 +136,7 @@ usrc_writeFileNameGeneratedBy(
time(&t);
lt=localtime(&t);
if(generator==nullptr) {
if(generator==nullptr && lt!=nullptr) {
strftime(buffer, sizeof(buffer), "%Y-%m-%d", lt);
fprintf(f, pattern, prefix, prefix, filename, prefix, prefix, buffer);
} else {