From 58aed2b87d1287bfa37b35d6a3692bcb6484d4b2 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 2 Apr 2018 19:26:16 -0500 Subject: Second argument to inet_ntop() is int, not long. (64 bit big endian systems care.) --- toys/net/netstat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toys/net/netstat.c b/toys/net/netstat.c index 4e5c884e..7d672488 100644 --- a/toys/net/netstat.c +++ b/toys/net/netstat.c @@ -275,7 +275,7 @@ static void display_routes(void) static const unsigned flagarray[] = { RTF_GATEWAY, RTF_HOST, RTF_REINSTATE, RTF_DYNAMIC, RTF_MODIFIED }; - unsigned long dest, gate, mask; + unsigned dest, gate, mask; int flags, ref, use, metric, mss, win, irtt; char *out = toybuf, *flag_val; char iface[64]={0}; @@ -290,7 +290,7 @@ static void display_routes(void) while (fgets(toybuf, sizeof(toybuf), fp)) { char *destip = 0, *gateip = 0, *maskip = 0; - if (11 != sscanf(toybuf, "%63s%lx%lx%X%d%d%d%lx%d%d%d", iface, &dest, + if (11 != sscanf(toybuf, "%63s%x%x%X%d%d%d%x%d%d%d", iface, &dest, &gate, &flags, &ref, &use, &metric, &mask, &mss, &win, &irtt)) break; -- cgit v1.2.3