summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-06-19 18:53:54 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-06-19 18:53:54 +0000
commit3fbb05ddeaca8a36b51ad957bb1a7c10e4f2706a (patch)
tree7a7d842eedeb7ecaa7c9c6b4d7ca6982c3274b14 /sbin
parentabe6ef910ba2aecb439bfce4a49a3140122496df (diff)
Since we can no longer count on isprint() to tell us whether or not
a character is 7-bit ASCII, check the high bit by hand when deciding whether to print a WEP key as ASCII or hex.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ifconfig/ifconfig.c7
-rw-r--r--sbin/wicontrol/wicontrol.c7
2 files changed, 8 insertions, 6 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 02bff1abac1..d984aef9aca 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.67 2002/06/14 09:12:43 itojun Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.68 2002/06/19 18:53:53 millert Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
@@ -81,7 +81,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
#else
-static const char rcsid[] = "$OpenBSD: ifconfig.c,v 1.67 2002/06/14 09:12:43 itojun Exp $";
+static const char rcsid[] = "$OpenBSD: ifconfig.c,v 1.68 2002/06/19 18:53:53 millert Exp $";
#endif
#endif /* not lint */
@@ -1102,7 +1102,8 @@ print_string(buf, len)
hasspc = 0;
if (len < 2 || buf[0] != '0' || tolower(buf[1]) != 'x') {
for (; i < len; i++) {
- if (!isprint(buf[i]))
+ /* Only print 7-bit ASCII keys */
+ if (buf[i] & 0x80 || !isprint(buf[i]))
break;
if (isspace(buf[i]))
hasspc++;
diff --git a/sbin/wicontrol/wicontrol.c b/sbin/wicontrol/wicontrol.c
index 6ddd3e1bc23..1b7e67317fb 100644
--- a/sbin/wicontrol/wicontrol.c
+++ b/sbin/wicontrol/wicontrol.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wicontrol.c,v 1.37 2002/06/02 16:11:41 millert Exp $ */
+/* $OpenBSD: wicontrol.c,v 1.38 2002/06/19 18:53:53 millert Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -69,7 +69,7 @@
static const char copyright[] = "@(#) Copyright (c) 1997, 1998, 1999\
Bill Paul. All rights reserved.";
static const char rcsid[] =
- "@(#) $OpenBSD: wicontrol.c,v 1.37 2002/06/02 16:11:41 millert Exp $";
+ "@(#) $OpenBSD: wicontrol.c,v 1.38 2002/06/19 18:53:53 millert Exp $";
#endif
void wi_getval(char *, struct wi_req *);
@@ -351,7 +351,8 @@ wi_printkeys(wreq)
k = &keys->wi_keys[i];
ptr = (char *)k->wi_keydat;
for (j = 0; j < letoh16(k->wi_keylen); j++) {
- if (!isprint((unsigned char)ptr[j])) {
+ /* Only print 7-bit ASCII keys */
+ if (ptr[j] & 0x80 || !isprint((unsigned char)ptr[j])) {
bn = 1;
break;
}