diff options
author | morriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-05-17 18:58:40 +0000 |
---|---|---|
committer | morriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-05-17 18:58:40 +0000 |
commit | 18c12d416e8d7aaf10391da6979948e50e05e8da (patch) | |
tree | 238df2bb8c8d79159022e40db54ba7e738f3f94f /epan/dissectors/packet-hci_h1.c | |
parent | fa333ffbae4b4a6693330a969fce5d0b27efd68d (diff) |
As suggested by Chris: use val_to_str_const() instead of match_strval() plus a
NULL-return check.
Use val_to_str_const instead of val_to_str() in a couple places where the string
is constant.
Use val_to_str() instead of blindly passing the return value from match_strval()
into a format routine (to ensure a non-NULL string pointer). A couple of these
were cases where it could not actually return NULL, but I changed it for
consistency.
Store the return value of match_strval() rather than calling it repeatedly.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37204 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-hci_h1.c')
-rw-r--r-- | epan/dissectors/packet-hci_h1.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/epan/dissectors/packet-hci_h1.c b/epan/dissectors/packet-hci_h1.c index a8e2d03062..5d7b7ebf50 100644 --- a/epan/dissectors/packet-hci_h1.c +++ b/epan/dissectors/packet-hci_h1.c @@ -71,12 +71,12 @@ dissect_hci_h1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if(tree){ ti = proto_tree_add_item(tree, proto_hci_h1, tvb, 0, 0, FALSE); hci_h1_tree = proto_item_add_subtree(ti, ett_hci_h1); - + if(pinfo->p2p_dir == P2P_DIR_SENT || pinfo->p2p_dir == P2P_DIR_RECV) proto_item_append_text(hci_h1_tree, " %s %s", - match_strval(pinfo->p2p_dir, - hci_h1_direction_vals), + val_to_str(pinfo->p2p_dir, + hci_h1_direction_vals, "Unknown: %d"), val_to_str(type, hci_h1_type_vals, "Unknown 0x%02x")); @@ -91,8 +91,8 @@ dissect_hci_h1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if(pinfo->p2p_dir == P2P_DIR_SENT || pinfo->p2p_dir == P2P_DIR_RECV) col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s", - match_strval(pinfo->p2p_dir, - hci_h1_direction_vals), + val_to_str(pinfo->p2p_dir, + hci_h1_direction_vals, "Unknown: %d"), val_to_str(type, hci_h1_type_vals, "Unknown 0x%02x")); else |