summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2013-11-21 17:24:35 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2013-11-21 17:24:35 +0000
commit65b268b253c31f769eaa1004edd7d6fec6ea512e (patch)
treeb2b89abef41d76f91103af35b23e5e65059d4921
parentdce81ecdfcff3d45ce3aae2c14acb9ff18c6210f (diff)
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.h4
-rw-r--r--sbin/ifconfig/ifconfig.c12
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++;