Module Name: src
Committed By: ryo
Date: Thu Jan 2 23:02:19 UTC 2020
Modified Files:
src/sbin/ifconfig: ether.c ifconfig.c
Log Message:
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)
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sbin/ifconfig/ether.c
cvs rdiff -u -r1.240 -r1.241 src/sbin/ifconfig/ifconfig.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/ifconfig/ether.c
diff -u src/sbin/ifconfig/ether.c:1.7 src/sbin/ifconfig/ether.c:1.8
--- src/sbin/ifconfig/ether.c:1.7 Fri Aug 16 10:33:17 2019
+++ src/sbin/ifconfig/ether.c Thu Jan 2 23:02:19 2020
@@ -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 @@ ether_status(prop_dictionary_t env, prop
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;
}
}
Index: src/sbin/ifconfig/ifconfig.c
diff -u src/sbin/ifconfig/ifconfig.c:1.240 src/sbin/ifconfig/ifconfig.c:1.241
--- src/sbin/ifconfig/ifconfig.c:1.240 Fri Aug 16 10:33:17 2019
+++ src/sbin/ifconfig/ifconfig.c Thu Jan 2 23:02:19 2020
@@ -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 @@ status(const struct sockaddr *sdl, prop_
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;
}
}