diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-01-06 03:08:03 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-01-06 03:08:03 +0000 |
commit | 5a2ef3cb01a718af1dfc330eeb12271acad25827 (patch) | |
tree | d3bf02b09e8c5568780e3fd31f1f8ff41c8992d0 /epan/dissectors/packet-yhoo.c | |
parent | eaea4695335c9a347b8b50a6543f99d311e8b790 (diff) |
Use tvb_memeql() instead of memcmp()+tvb_get_ptr().
svn path=/trunk/; revision=35398
Diffstat (limited to 'epan/dissectors/packet-yhoo.c')
-rw-r--r-- | epan/dissectors/packet-yhoo.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/epan/dissectors/packet-yhoo.c b/epan/dissectors/packet-yhoo.c index 04126de451..15d2157866 100644 --- a/epan/dissectors/packet-yhoo.c +++ b/epan/dissectors/packet-yhoo.c @@ -190,8 +190,8 @@ dissect_yhoo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) return FALSE; } - if (memcmp(tvb_get_ptr(tvb, offset, 4), "YPNS", 4) != 0 && - memcmp(tvb_get_ptr(tvb, offset, 4), "YHOO", 4) != 0) { + if (tvb_memeql(tvb, offset, "YPNS", 4) != 0 && + tvb_memeql(tvb, offset, "YHOO", 4) != 0) { /* Not a Yahoo Messenger packet. */ return FALSE; } @@ -200,12 +200,10 @@ dissect_yhoo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset = 0; if (check_col(pinfo->cinfo, COL_INFO)) { - col_add_fstr(pinfo->cinfo, COL_INFO, - "%s: %s", - ( strncmp((gchar*)tvb_get_ptr(tvb, offset + 0, 4), "YPNS", 4) == 0 ) ? "Request" : "Response", - val_to_str(tvb_get_letohl(tvb, offset + 12), - yhoo_service_vals, "Unknown Service: %u") - ); + col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s", + ( tvb_memeql(tvb, offset + 0, "YPNS", 4) == 0 ) ? "Request" : "Response", + val_to_str(tvb_get_letohl(tvb, offset + 12), + yhoo_service_vals, "Unknown Service: %u")); } if (tree) { |