Code

src/liboping.c: Fix debugging statement.
authorFlorian Forster <ff@octo.it>
Fri, 5 May 2017 09:07:48 +0000 (11:07 +0200)
committerFlorian Forster <ff@octo.it>
Fri, 5 May 2017 09:07:48 +0000 (11:07 +0200)
The dprintf() macro referred to a variable which no longer exists,
which only surfaced when compiling with --enable-debug.

src/liboping.c

index fd6e94227e4f7ff68d50c8eff308ea9d35a7afd4..117cbfac893b16639be2beb926ac54159d66ebf8 100644 (file)
@@ -1478,9 +1478,10 @@ int ping_send (pingobj_t *obj)
                if (ping_timeval_sub (&endtime, &nowtime, &timeout) == -1)
                        break;
 
-               dprintf ("Waiting on %i sockets for %i.%06i seconds\n", num_fds,
-                               (int) timeout.tv_sec,
-                               (int) timeout.tv_usec);
+               dprintf ("Waiting on %i sockets for %u.%06u seconds\n",
+                               ((obj->fd4 != -1) ? 1 : 0) + ((obj->fd6 != -1) ? 1 : 0),
+                               (unsigned) timeout.tv_sec,
+                               (unsigned) timeout.tv_usec);
 
                int status = select (max_fd + 1, &read_fds, &write_fds, NULL, &timeout);