Source-Changes-HG archive

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

[src/trunk]: src/sbin/ifconfig fix printing capabilities and enabled flags.



details:   https://anonhg.NetBSD.org/src/rev/100c76ea8c99
branches:  trunk
changeset: 466829:100c76ea8c99
user:      ryo <ryo%NetBSD.org@localhost>
date:      Thu Jan 02 23:02:19 2020 +0000

description:
fix printing capabilities and enabled flags.

no need to skip a prefix "0x" of output of snprintb.
ifconfig expect the result of snprintb has "0x" prefix, but snprintb(3) specification has changed
so that if 0 is passed, it prints "0" instead of "0x0". (common/lib/libutil/snprintb.c r1.22)

diffstat:

 sbin/ifconfig/ether.c    |  8 ++++----
 sbin/ifconfig/ifconfig.c |  8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diffs (70 lines):

diff -r 4fde44885534 -r 100c76ea8c99 sbin/ifconfig/ether.c
--- a/sbin/ifconfig/ether.c     Thu Jan 02 23:01:54 2020 +0000
+++ b/sbin/ifconfig/ether.c     Thu Jan 02 23:02:19 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ether.c,v 1.7 2019/08/16 10:33:17 msaitoh Exp $        */
+/*     $NetBSD: ether.c,v 1.8 2020/01/02 23:02:19 ryo Exp $    */
 
 /*
  * Copyright (c) 1983, 1993
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ether.c,v 1.7 2019/08/16 10:33:17 msaitoh Exp $");
+__RCSID("$NetBSD: ether.c,v 1.8 2020/01/02 23:02:19 ryo Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -165,14 +165,14 @@
                    eccr.eccr_capabilities, MAX_PRINT_LEN);
                bp = fbuf;
                while (*bp != '\0') {
-                       printf("\tec_capabilities=%s\n", &bp[2]);
+                       printf("\tec_capabilities=%s\n", bp);
                        bp += strlen(bp) + 1;
                }
                (void)snprintb_m(fbuf, sizeof(fbuf), ECCAPBITS,
                    eccr.eccr_capenable, MAX_PRINT_LEN);
                bp = fbuf;
                while (*bp != '\0') {
-                       printf("\tec_enabled=%s\n", &bp[2]);
+                       printf("\tec_enabled=%s\n", bp);
                        bp += strlen(bp) + 1;
                }
        }
diff -r 4fde44885534 -r 100c76ea8c99 sbin/ifconfig/ifconfig.c
--- a/sbin/ifconfig/ifconfig.c  Thu Jan 02 23:01:54 2020 +0000
+++ b/sbin/ifconfig/ifconfig.c  Thu Jan 02 23:02:19 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ifconfig.c,v 1.240 2019/08/16 10:33:17 msaitoh Exp $   */
+/*     $NetBSD: ifconfig.c,v 1.241 2020/01/02 23:02:19 ryo Exp $       */
 
 /*-
  * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1983, 1993\
  The Regents of the University of California.  All rights reserved.");
-__RCSID("$NetBSD: ifconfig.c,v 1.240 2019/08/16 10:33:17 msaitoh Exp $");
+__RCSID("$NetBSD: ifconfig.c,v 1.241 2020/01/02 23:02:19 ryo Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -1318,14 +1318,14 @@
                    ifcr.ifcr_capabilities, MAX_PRINT_LEN);
                bp = fbuf;
                while (*bp != '\0') {
-                       printf("\tcapabilities=%s\n", &bp[2]);
+                       printf("\tcapabilities=%s\n", bp);
                        bp += strlen(bp) + 1;
                }
                (void)snprintb_m(fbuf, sizeof(fbuf), IFCAPBITS,
                    ifcr.ifcr_capenable, MAX_PRINT_LEN);
                bp = fbuf;
                while (*bp != '\0') {
-                       printf("\tenabled=%s\n", &bp[2]);
+                       printf("\tenabled=%s\n", bp);
                        bp += strlen(bp) + 1;
                }
        }



Home | Main Index | Thread Index | Old Index