]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
ui: don't cast to void* when calling display_rawhost() 389/head
authorVincent Bernat <vincent@bernat.ch>
Mon, 8 Mar 2021 07:29:53 +0000 (08:29 +0100)
committerVincent Bernat <vincent@bernat.ch>
Mon, 8 Mar 2021 07:29:53 +0000 (08:29 +0100)
The provided types are compatible with the function signature.
Moreover, this seems to hide a bug where `display_rawhost()` is called
with an address instead of an MPLS struct.

ui/net.c

index e4752b730359ccd2ed250f70ffc614821c5587a8..c71440bcdca1de3496152177f5e66249a19456e1 100644 (file)
--- a/ui/net.c
+++ b/ui/net.c
@@ -256,7 +256,7 @@ static void net_process_ping(
             memcpy(&nh->addrs[i], &nh->addr, sockaddr_addr_size(sourcesockaddr));
 
             nh->mplss[i] = nh->mpls;
-            display_rawhost(ctl, index, (void *)&(nh->addrs[i]), (void *)&(nh->addrs[i]));
+            display_rawhost(ctl, index, &nh->addrs[i], &nh->mpls);
         }
 
         /* Always save the latest host in nh->addr. This
@@ -264,7 +264,7 @@ static void net_process_ping(
          */
         memcpy(&nh->addr, addrcopy, sockaddr_addr_size(sourcesockaddr));
         nh->mpls = *mpls;
-        display_rawhost(ctl, index, (void *)&(nh->addr), (void *)&(nh->mpls));
+        display_rawhost(ctl, index, &nh->addr, &nh->mpls);
     }
 
     nh->jitter = totusec - nh->last;