neighbor table: fix crash in olsr_print_neighbor_table on MinGW
authorFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 9 Dec 2013 10:28:23 +0000 (11:28 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 9 Dec 2013 10:28:37 +0000 (11:28 +0100)
Reported-by: Harald Sighart <hsighart@gmail.com>
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/neighbor_table.c

index f7c4aae..23a349f 100644 (file)
@@ -385,15 +385,10 @@ olsr_print_neighbor_table(void)
   /* The whole function doesn't do anything else. */
   const int iplen = olsr_cnf->ip_version == AF_INET ? (INET_ADDRSTRLEN - 1) : (INET6_ADDRSTRLEN - 1);
   int idx;
-  struct tm * nowtm;
-  struct timeval now;
-
-       (void)gettimeofday(&now, NULL);
-  nowtm = localtime((time_t *)&now.tv_sec);
 
   OLSR_PRINTF(1,
-              "\n--- %02d:%02d:%02d.%02d ------------------------------------------------ NEIGHBORS\n\n"
-              "%*s  LQ     NLQ    SYM   MPR   MPRS  will\n", nowtm->tm_hour, nowtm->tm_min, nowtm->tm_sec, (int)now.tv_usec / 10000,
+              "\n--- %s ------------------------------------------------ NEIGHBORS\n\n"
+              "%*s  LQ     NLQ    SYM   MPR   MPRS  will\n", olsr_wallclock_string(),
               iplen, "IP address");
 
   for (idx = 0; idx < HASHSIZE; idx++) {