From 5ef06edbc38c9316f272d771ea3f43fc455f4807 Mon Sep 17 00:00:00 2001 From: nisimura Date: Tue, 3 Mar 2020 08:56:05 +0000 Subject: [PATCH] - show " refcount %d" for consistency - fix an extra : bug which was introduced rev 1.17 --- usr.sbin/ifmcstat/ifmcstat.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/usr.sbin/ifmcstat/ifmcstat.c b/usr.sbin/ifmcstat/ifmcstat.c index 757a4c007587..84a618934d7e 100644 --- a/usr.sbin/ifmcstat/ifmcstat.c +++ b/usr.sbin/ifmcstat/ifmcstat.c @@ -1,4 +1,4 @@ -/* $NetBSD: ifmcstat.c,v 1.21 2017/02/23 07:57:10 ozaki-r Exp $ */ +/* $NetBSD: ifmcstat.c,v 1.22 2020/03/03 08:56:05 nisimura Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -29,7 +29,7 @@ * SUCH DAMAGE. */ #include -__RCSID("$NetBSD: ifmcstat.c,v 1.21 2017/02/23 07:57:10 ozaki-r Exp $"); +__RCSID("$NetBSD: ifmcstat.c,v 1.22 2020/03/03 08:56:05 nisimura Exp $"); #include #include @@ -114,7 +114,7 @@ static void print_hwaddr(const uint8_t *hwaddr, size_t len) { while (len) - printf("%02x%s", *hwaddr++, len-- == 0 ? "" : ":"); + printf("%02x%s", *hwaddr++, --len > 0 ? ":" : ""); } static void @@ -167,10 +167,10 @@ print_ether_mcast(u_short ifindex) for (i = 0; i < ems_len; ++i) { printf("\t\t"); - print_hwaddr(ems[i].enm_addrlo, sizeof(ems[i].enm_addrlo)); + print_hwaddr(ems[i].enm_addrlo, sdl_len); printf(" -- "); - print_hwaddr(ems[i].enm_addrhi, sizeof(ems[i].enm_addrhi)); - printf(" %d\n", ems[i].enm_refcount); + print_hwaddr(ems[i].enm_addrhi, sdl_len); + printf(" refcount %d\n", ems[i].enm_refcount); } free(ems); free(hwaddr);