Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/ifmcstat - show " refcount %d" for consistency



details:   https://anonhg.NetBSD.org/src/rev/cd27c84ad7e4
branches:  trunk
changeset: 969863:cd27c84ad7e4
user:      nisimura <nisimura%NetBSD.org@localhost>
date:      Tue Mar 03 08:56:05 2020 +0000

description:
- show " refcount %d" for consistency
- fix an extra : bug which was introduced rev 1.17

diffstat:

 usr.sbin/ifmcstat/ifmcstat.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (41 lines):

diff -r 32108791d4cc -r cd27c84ad7e4 usr.sbin/ifmcstat/ifmcstat.c
--- a/usr.sbin/ifmcstat/ifmcstat.c      Tue Mar 03 08:13:44 2020 +0000
+++ b/usr.sbin/ifmcstat/ifmcstat.c      Tue Mar 03 08:56:05 2020 +0000
@@ -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 <sys/cdefs.h>
-__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 <err.h>
 #include <errno.h>
@@ -114,7 +114,7 @@
 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 @@
 
        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);



Home | Main Index | Thread Index | Old Index