summaryrefslogtreecommitdiff
path: root/sbin/wicontrol/wicontrol.c
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/wicontrol/wicontrol.c
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/wicontrol/wicontrol.c')
-rw-r--r--sbin/wicontrol/wicontrol.c7
1 files changed, 4 insertions, 3 deletions
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;
}