replace NULL with 0 in time function

This commit is contained in:
Dennis Eichhorn 2022-12-28 03:48:59 +01:00
parent 593fbc9f89
commit f8878d757a

View File

@ -34,7 +34,7 @@ void ms_to_timespec(struct timespec *ts, unsigned int ms)
return;
}
ts->tv_sec = (ms / 1000) + time(NULL);
ts->tv_sec = (ms / 1000) + time(0);
ts->tv_nsec = (ms % 1000) * 1000000;
}
@ -211,7 +211,7 @@ void ms_to_timespec(struct timespec *ts, unsigned int ms)
return INFINITE;
}
t = ((abstime->tv_sec - time(NULL)) * 1000) + (abstime->tv_nsec / 1000000);
t = ((abstime->tv_sec - time(0)) * 1000) + (abstime->tv_nsec / 1000000);
if (t < 0) {
t = 1;
}