aboutsummaryrefslogtreecommitdiffstats
path: root/packet-clnp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-07-10 06:52:29 +0000
committerGuy Harris <guy@alum.mit.edu>2000-07-10 06:52:29 +0000
commit4c3db57f202e805dd14cce68ba1e1c784e15779b (patch)
tree0bd20d6f551f577224bfc48d4bb4d2fad25cc833 /packet-clnp.c
parentebb525fac6a5270ade6bab6c4ea81f1d3173eaa1 (diff)
downloadwireshark-4c3db57f202e805dd14cce68ba1e1c784e15779b.tar.gz
wireshark-4c3db57f202e805dd14cce68ba1e1c784e15779b.tar.bz2
wireshark-4c3db57f202e805dd14cce68ba1e1c784e15779b.zip
Treat only ASCII characters as printable in TSAPs; otherwise, as 0xff
and 0xfe, for example, are printable characters in many locales (they're printable in ISO 8859/x, for example), a TSAP of 0xfffffffefffffffe will be treated as printable if your locale is one of those, even though the chances that the TSAP is should be read as a string of y-with-diaresis and lower-case thorn are pretty slim. svn path=/trunk/; revision=2131
Diffstat (limited to 'packet-clnp.c')
-rw-r--r--packet-clnp.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/packet-clnp.c b/packet-clnp.c
index 3ca796c43f..d7aecddb55 100644
--- a/packet-clnp.c
+++ b/packet-clnp.c
@@ -1,7 +1,7 @@
/* packet-clnp.c
* Routines for ISO/OSI network and transport protocol packet disassembly
*
- * $Id: packet-clnp.c,v 1.9 2000/07/01 08:55:26 guy Exp $
+ * $Id: packet-clnp.c,v 1.10 2000/07/10 06:52:29 guy Exp $
* Laurent Deniel <deniel@worldnet.fr>
* Ralf Schneider <Ralf.Schneider@t-online.de>
*
@@ -281,8 +281,15 @@ static gchar *print_tsap(const u_char *tsap, int length)
else {
allprintable=TRUE;
for (i=0;i<length;i++) {
- if (!isprint(tsap[i])) { /* if any byte is not printable */
- allprintable=FALSE; /* switch to hexdump */
+ /* If any byte is not printable ASCII, display the TSAP as a
+ series of hex byte values rather than as a string; this
+ means that, for example, accented letters will cause it
+ to be displayed as hex, but it also means that byte values
+ such as 0xff and 0xfe, which *are* printable ISO 8859/x
+ characters, won't be treated as printable - 0xfffffffe
+ is probably binary, not text. */
+ if (!(isascii(tsap[i]) && isprint(tsap[i]))) {
+ allprintable=FALSE;
break;
}
}