From: Vincent Bernat Date: Mon, 8 Mar 2021 07:29:53 +0000 (+0100) Subject: ui: don't cast to void* when calling display_rawhost() X-Git-Tag: v0.95~12^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c72b2cbc6ff9b9ca52ac6743bfa99d555bcb280;p=thirdparty%2Fmtr.git ui: don't cast to void* when calling display_rawhost() 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. --- diff --git a/ui/net.c b/ui/net.c index e4752b7..c71440b 100644 --- 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;