fix(mkdwarfs_main): only store time resolution if necessary

This commit is contained in:
Marcus Holland-Moritz 2025-05-15 20:48:36 +02:00
parent 6448dd0810
commit 53384f6faf

View File

@ -1048,8 +1048,8 @@ int mkdwarfs_main(int argc, sys_char** argv, iolayer const& iol) {
if (auto it = time_resolutions.find(time_resolution); if (auto it = time_resolutions.find(time_resolution);
it != time_resolutions.end()) { it != time_resolutions.end()) {
options.metadata.time_resolution_sec = it->second; options.metadata.time_resolution_sec = it->second;
} else if (auto val = try_to<uint32_t>(time_resolution)) { } else if (auto val = try_to<uint32_t>(time_resolution); val && *val != 1) {
options.metadata.time_resolution_sec = *val; options.metadata.time_resolution_sec = val;
if (options.metadata.time_resolution_sec == 0) { if (options.metadata.time_resolution_sec == 0) {
iol.err << "error: the argument to '--time-resolution' must be nonzero\n"; iol.err << "error: the argument to '--time-resolution' must be nonzero\n";
return 1; return 1;