aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-csm-encaps.c
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2005-10-05 15:44:04 +0000
committerJörg Mayer <jmayer@loplof.de>2005-10-05 15:44:04 +0000
commit402c4dd9a70f61da922d44db85c772192039cbe8 (patch)
tree30901b8a521e834f2e2b19a1105ece40bfb9bfe6 /epan/dissectors/packet-csm-encaps.c
parent5aea051727036565048d37efd4ea04981696fd03 (diff)
Don't reinvent the wheel, use val_to_str/match_strval
svn path=/trunk/; revision=16130
Diffstat (limited to 'epan/dissectors/packet-csm-encaps.c')
-rw-r--r--epan/dissectors/packet-csm-encaps.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/epan/dissectors/packet-csm-encaps.c b/epan/dissectors/packet-csm-encaps.c
index 0c192fd677..5320601e08 100644
--- a/epan/dissectors/packet-csm-encaps.c
+++ b/epan/dissectors/packet-csm-encaps.c
@@ -193,32 +193,14 @@ gchar *csm_fc(guint16 fc, guint16 ct)
/* check to see if the message is an exclusive message send to host */
gboolean csm_to_host(guint16 fc, guint16 ct)
{
- guint16 i=0;
-
if (fc == 0x0000)
{
- while (1)
- {
- if (exclusive_to_host_ct_vals[i].strptr == NULL)
- return FALSE;
- else if (exclusive_to_host_ct_vals[i].value == ct)
- return TRUE;
- i++;
- }
+ return (match_strval(ct, exclusive_to_host_ct_vals) != NULL);
}
-
else
{
- while (1)
- {
- if (exclusive_to_host_vals[i].strptr == NULL)
- return FALSE;
- else if (exclusive_to_host_vals[i].value == fc)
- return TRUE;
- i++;
- }
+ return (match_strval(fc, exclusive_to_host_vals) != NULL);
}
- return FALSE;
}