Skip to content

Commit e120a92

Browse files
committed
fix: uninitialized value revealed by clang-21 warning (#4940)
Signed-off-by: Larry Gritz <[email protected]>
1 parent 89568d6 commit e120a92

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/iconvert/iconvert.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ DateTime_to_time_t(string_view datetime, time_t& timet)
152152
return false;
153153
// OIIO::print("{}:{}:{} {}:{}:{}\n", year, month, day, hour, min, sec);
154154
struct tm tmtime;
155-
time_t now;
155+
time_t now = time(nullptr);
156156
Sysutil::get_local_time(&now, &tmtime); // fill in defaults
157157
tmtime.tm_sec = sec;
158158
tmtime.tm_min = min;

src/oiiotool/oiiotool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ DateTime_to_time_t(string_view datetime, time_t& timet)
10461046
return false;
10471047
// OIIO::print("{}:{}:{} {}:{}:{}\n", year, month, day, hour, min, sec);
10481048
struct tm tmtime;
1049-
time_t now;
1049+
time_t now = time(nullptr);
10501050
Sysutil::get_local_time(&now, &tmtime); // fill in defaults
10511051
tmtime.tm_sec = sec;
10521052
tmtime.tm_min = min;

0 commit comments

Comments
 (0)