VISO: Fix small mistake in timestamp clamping

This commit is contained in:
RichardG867
2022-10-25 22:07:55 -03:00
parent 992c92e120
commit ea351e99fc

View File

@@ -420,8 +420,8 @@ viso_fill_time(uint8_t *data, time_t time, int format, int longform)
if (!time_s) {
/* localtime will return NULL if the time_t is negative (Windows)
or way too far into 64-bit space (Linux). Fall back to epoch. */
time = 0;
time_s = localtime(&time);
time_t epoch = 0;
time_s = localtime(&epoch);
if (!time_s)
fatal("VISO: localtime(0) = NULL\n");