diff options
author | 2013-11-21 17:24:34 +0000 | |
---|---|---|
committer | 2013-11-21 17:24:34 +0000 | |
commit | f25dfd79e05b83df4afbd4bf22df6d5587eb4298 (patch) | |
tree | e2451dab34ac806fbfb566e431adc0b98299d932 | |
parent | Cast daddr_t variable to (long long) even for %llx! (diff) | |
download | wireguard-openbsd-f25dfd79e05b83df4afbd4bf22df6d5587eb4298.tar.xz wireguard-openbsd-f25dfd79e05b83df4afbd4bf22df6d5587eb4298.zip |
Make the bit string unsigned char * in printb() and printb_status().
In practice we shouldn't have chars > 127 in these but it is better
not to assume this. OK deraadt@
-rw-r--r-- | sbin/ifconfig/brconfig.h | 4 | ||||
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/sbin/ifconfig/brconfig.h b/sbin/ifconfig/brconfig.h index 1e797a0450d..882d21457e3 100644 --- a/sbin/ifconfig/brconfig.h +++ b/sbin/ifconfig/brconfig.h @@ -1,4 +1,4 @@ -/* $OpenBSD: brconfig.h,v 1.6 2012/08/21 19:50:39 bluhm Exp $ */ +/* $OpenBSD: brconfig.h,v 1.7 2013/11/21 17:24:34 millert Exp $ */ /* * Copyright (c) 2009 Claudio Jeker <claudio@openbsd.org> @@ -71,5 +71,5 @@ int bridge_rule(int, char **, int); "\15LINK0\16LINK1\17LINK2\20MULTICAST\21TXREADY\22NOINET6" \ "\23INET6_NOPRIVACY\24MPLS\25WOL" -void printb(char *, unsigned int, char *); +void printb(char *, unsigned int, unsigned char *); diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 5180c59b302..a682ee80571 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.c,v 1.277 2013/11/12 04:59:02 deraadt Exp $ */ +/* $OpenBSD: ifconfig.c,v 1.278 2013/11/21 17:24:34 millert Exp $ */ /* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */ /* @@ -505,7 +505,7 @@ int getinfo(struct ifreq *, int); void getsock(int); void printgroupattribs(char *); void printif(char *, int); -void printb_status(unsigned short, char *); +void printb_status(unsigned short, unsigned char *); const char *get_linkstate(int, int); void status(int, struct sockaddr_dl *, int); void usage(int); @@ -4556,10 +4556,10 @@ in_getprefix(const char *plen, int which) * Print a value a la the %b format of the kernel's printf */ void -printb(char *s, unsigned int v, char *bits) +printb(char *s, unsigned int v, unsigned char *bits) { int i, any = 0; - char c; + unsigned char c; if (bits && *bits == 8) printf("%s=%o", s, v); @@ -4588,10 +4588,10 @@ printb(char *s, unsigned int v, char *bits) * A simple version of printb for status output */ void -printb_status(unsigned short v, char *bits) +printb_status(unsigned short v, unsigned char *bits) { int i, any = 0; - char c; + unsigned char c; if (bits) { bits++; |