diff options
author | njl <njl@FreeBSD.org> | 2006-01-26 19:55:29 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2006-01-26 19:55:29 +0000 |
commit | e987e3c294913597ae5cb3da5e72bf6c5d11ea06 (patch) | |
tree | d3bf17622e3771665a9c6e63701a7d005a4fec59 /sys/dev/an | |
parent | f9829317cf57823e912177e4cb28a7616a7f7d00 (diff) | |
download | FreeBSD-src-e987e3c294913597ae5cb3da5e72bf6c5d11ea06.zip FreeBSD-src-e987e3c294913597ae5cb3da5e72bf6c5d11ea06.tar.gz |
Since the A-Z range is contained in the previous check, the else-if is
dead code. Clean up both by using isprint() instead, since that's what
it really wants.
Coverity ID: 100
Found by: Coverity Prevent
Diffstat (limited to 'sys/dev/an')
-rw-r--r-- | sys/dev/an/if_an.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c index fd34900..ffd285a 100644 --- a/sys/dev/an/if_an.c +++ b/sys/dev/an/if_an.c @@ -88,6 +88,7 @@ __FBSDID("$FreeBSD$"); #endif #include <sys/param.h> +#include <sys/ctype.h> #include <sys/systm.h> #include <sys/sockio.h> #include <sys/mbuf.h> @@ -1593,9 +1594,7 @@ an_dump_record(struct an_softc *sc, struct an_ltv_gen *ltv, char *string) printf("%02x ", *ptr2); temp = *ptr2++; - if (temp >= ' ' && temp <= '~') - buf[count] = temp; - else if (temp >= 'A' && temp <= 'Z') + if (isprint(temp)) buf[count] = temp; else buf[count] = '.'; |