chiark / gitweb /
time-util: Fix overflow check introduce in commit f977849 (#5216)
authorBenjamin Robin <benjarobin@users.noreply.github.com>
Fri, 3 Feb 2017 15:13:55 +0000 (16:13 +0100)
committerSven Eden <yamakuzure@gmx.net>
Mon, 17 Jul 2017 15:58:36 +0000 (17:58 +0200)
src/basic/time-util.c

index 6a76b65..a2b57f8 100644 (file)
@@ -218,7 +218,7 @@ struct timespec *timespec_store(struct timespec *ts, usec_t u)  {
         assert(ts);
 
         if (u == USEC_INFINITY ||
-            u / USEC_INFINITY >= TIME_T_MAX) {
+            u / USEC_PER_SEC >= TIME_T_MAX) {
                 ts->tv_sec = (time_t) -1;
                 ts->tv_nsec = (long) -1;
                 return ts;