aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ansi_637.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2011-05-17 18:58:40 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2011-05-17 18:58:40 +0000
commitcdedb31e947919bb3082c026a0e01335a27055ed (patch)
tree238df2bb8c8d79159022e40db54ba7e738f3f94f /epan/dissectors/packet-ansi_637.c
parentc204df4719a1d1da3fe8a0b573b68f5b88bce3a2 (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. svn path=/trunk/; revision=37204
Diffstat (limited to 'epan/dissectors/packet-ansi_637.c')
-rw-r--r--epan/dissectors/packet-ansi_637.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ansi_637.c b/epan/dissectors/packet-ansi_637.c
index 39d6be0873..3c20368227 100644
--- a/epan/dissectors/packet-ansi_637.c
+++ b/epan/dissectors/packet-ansi_637.c
@@ -1339,9 +1339,7 @@ trans_param_srvc_cat(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset,
value = tvb_get_ntohs(tvb, offset);
- str = match_strval(value, ansi_srvc_cat_strings);
-
- if (NULL == str) str = "Reserved";
+ str = val_to_str_const(value, ansi_srvc_cat_strings, "Reserved");
proto_tree_add_text(tree, tvb, offset, 2,
"%s", str);