aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-3com-njack.c
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2009-09-24 15:44:59 +0000
committerBill Meier <wmeier@newsguy.com>2009-09-24 15:44:59 +0000
commit4f39e04e2971845b49c737e9baa05ee79d884f1f (patch)
treecc8187a7d06bdc9b52d8670f7d3af05ada4ee83a /epan/dissectors/packet-3com-njack.c
parent7ba4fb4ba8e7ccfe5a9e4b5794160958dd0559e8 (diff)
Minor changes:
- check_col no longer req'd; - use tvb_strncaseeql instead of tvb_get_ptr & etc; - Change if (guint > 0) to if (guint != 0). svn path=/trunk/; revision=30114
Diffstat (limited to 'epan/dissectors/packet-3com-njack.c')
-rw-r--r--epan/dissectors/packet-3com-njack.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/epan/dissectors/packet-3com-njack.c b/epan/dissectors/packet-3com-njack.c
index 41c75b9a63..b0d64146af 100644
--- a/epan/dissectors/packet-3com-njack.c
+++ b/epan/dissectors/packet-3com-njack.c
@@ -500,7 +500,7 @@ dissect_tlvs(tvbuff_t *tvb, proto_tree *njack_tree, guint32 offset)
offset += tlv_length;
break;
default:
- if (tlv_length > 0) {
+ if (tlv_length != 0) {
proto_tree_add_item(tlv_tree, hf_njack_tlv_data,
tvb, offset, tlv_length, FALSE);
offset += tlv_length;
@@ -576,11 +576,8 @@ dissect_njack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gint remaining;
packet_type = tvb_get_guint8(tvb, 5);
- if (check_col(pinfo->cinfo, COL_PROTOCOL))
- col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_SHORT_NAME);
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_str(pinfo->cinfo, COL_INFO, val_to_str(packet_type,
- njack_type_vals, "Type 0x%02x"));
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_SHORT_NAME);
+ col_add_str(pinfo->cinfo, COL_INFO, val_to_str(packet_type, njack_type_vals, "Type 0x%02x"));
if (tree) {
ti = proto_tree_add_item(tree, proto_njack, tvb, offset, -1,
@@ -614,8 +611,7 @@ dissect_njack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(njack_tree, hf_njack_setresult, tvb, offset,
1, FALSE);
offset += 1;
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, ": %s",
+ col_append_fstr(pinfo->cinfo, COL_INFO, ": %s",
val_to_str(setresult, njack_setresult_vals, "[0x%02x]"));
break;
case NJACK_TYPE_GET:
@@ -650,9 +646,9 @@ static gboolean
test_njack(tvbuff_t *tvb)
{
/* We need at least 'NJ200' + 1 Byte packet type */
- if ( tvb_length(tvb) < 6 ||
- g_ascii_strncasecmp((const char *)tvb_get_ptr(tvb, 0, 5), "NJ200", 5) ) {
- return FALSE;
+ if ( (tvb_length(tvb) < 6) ||
+ (tvb_strncaseeql(tvb, 0, "NJ200", 5) != 0) ) {
+ return FALSE;
}
return TRUE;
}