diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-09-09 08:53:48 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-09-09 08:53:48 +0000 |
commit | 4605a6b5b38117a21f0268a5ed352b2209d1a170 (patch) | |
tree | 049b73abf710cf8ace696cf837170f8ab737aa14 /packet-gprs-ns.c | |
parent | f7b8844b7f7f1de34f34505feada96e975014690 (diff) | |
download | wireshark-4605a6b5b38117a21f0268a5ed352b2209d1a170.tar.gz |
Don't use "match_strval()" unless you know the value is going to match
or you are prepared to handle a null pointer return value; use
"val_to_str()" if you want an "Unknown (XXX)" string if the value is
unknown.
svn path=/trunk/; revision=8429
Diffstat (limited to 'packet-gprs-ns.c')
-rw-r--r-- | packet-gprs-ns.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/packet-gprs-ns.c b/packet-gprs-ns.c index e24cc87984..a001feeb2d 100644 --- a/packet-gprs-ns.c +++ b/packet-gprs-ns.c @@ -3,7 +3,7 @@ * dissection * Copyright 2003, Josef Korelus <jkor@quick.cz> * - * $Id: packet-gprs-ns.c,v 1.3 2003/09/09 07:51:37 guy Exp $ + * $Id: packet-gprs-ns.c,v 1.4 2003/09/09 08:53:48 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -257,8 +257,10 @@ dissect_gprs_ns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_clear(pinfo->cinfo, COL_INFO); nspdu = tvb_get_guint8(tvb,offset); - if (check_col(pinfo->cinfo, COL_INFO)) - col_add_str(pinfo->cinfo, COL_INFO, match_strval(nspdu, ns_pdu_type)); + if (check_col(pinfo->cinfo, COL_INFO)) { + col_add_str(pinfo->cinfo, COL_INFO, + val_to_str(nspdu, ns_pdu_type, "Unknown PDU type (0x%02x)")); + } if (tree) { ti = proto_tree_add_item(tree, proto_gprs_ns, tvb, 0, -1, FALSE); gprs_ns_tree = proto_item_add_subtree(ti, ett_gprs_ns); |