diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2010-10-30 18:18:12 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2010-10-30 18:18:12 +0000 |
commit | f5d3a16225b9d467b052dfa79fe07a61d6403277 (patch) | |
tree | bc1f07c6ce8f5804ee5905dd65a414a16bbea7b1 /epan | |
parent | f24037c964768d336a8c780f3890eb30bea86c71 (diff) |
Make tvb_strneql()'s size parameter be a size_t. Remove some now-unnecessary casts.
svn path=/trunk/; revision=34725
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-hsrp.c | 14 | ||||
-rw-r--r-- | epan/dissectors/packet-mac-lte.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-msrp.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-pdcp-lte.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-sap.c | 4 | ||||
-rw-r--r-- | epan/tvbuff.c | 6 | ||||
-rw-r--r-- | epan/tvbuff.h | 2 |
7 files changed, 16 insertions, 16 deletions
diff --git a/epan/dissectors/packet-hsrp.c b/epan/dissectors/packet-hsrp.c index 56f4e65c2f..5e6809dc58 100644 --- a/epan/dissectors/packet-hsrp.c +++ b/epan/dissectors/packet-hsrp.c @@ -26,7 +26,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* +/* * RFC 2281 describes opcodes 0 - 2 * * Op Code 3: **** HSRP Interface State Advertisements **** @@ -63,7 +63,7 @@ * * HSRP Version 2 * Ref. http://www.smartnetworks.jp/2006/02/hsrp_8_hsrp_version_2.html (Japanese Only) - * + * * Group State TLV * * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 @@ -350,7 +350,7 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) opcode = tvb_get_guint8(tvb, 1); if (check_col(pinfo->cinfo, COL_INFO)) { - col_add_str(pinfo->cinfo, COL_INFO, + col_add_str(pinfo->cinfo, COL_INFO, val_to_str(opcode, hsrp_opcode_vals, "Unknown")); } if (opcode < 3) { @@ -407,7 +407,7 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) auth_buf[sizeof auth_buf - 1] = '\0'; proto_tree_add_string_format(hsrp_tree, hf_hsrp_auth_data, tvb, offset, 8, auth_buf, "Authentication Data: %sDefault (%s)", - (tvb_strneql(tvb, offset, "cisco", (int)strlen("cisco"))) == 0 ? "" : "Non-", + (tvb_strneql(tvb, offset, "cisco", strlen("cisco"))) == 0 ? "" : "Non-", auth_buf); offset += 8; proto_tree_add_item(hsrp_tree, hf_hsrp_virt_ip_addr, tvb, offset, 4, FALSE); @@ -470,7 +470,7 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(opcode, hsrp2_opcode_vals, "Unknown")); } - + state = tvb_get_guint8(tvb, offset+2); if (check_col(pinfo->cinfo, COL_INFO)) { col_append_fstr(pinfo->cinfo, COL_INFO, " (state %s)", @@ -527,7 +527,7 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint16 active,passive; active = tvb_get_ntohs(tvb, offset+2); passive = tvb_get_ntohs(tvb, offset+4); - + if (check_col(pinfo->cinfo, COL_INFO)) { col_add_fstr(pinfo->cinfo, COL_INFO, "Interface State TLV (Act=%d Pass=%d)",active,passive); } @@ -562,7 +562,7 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) auth_buf[sizeof auth_buf - 1] = '\0'; proto_tree_add_string_format(text_auth_tlv, hf_hsrp2_auth_data, tvb, offset, 8, auth_buf, "Authentication Data: %sDefault (%s)", - (tvb_strneql(tvb, offset, "cisco", (int)strlen("cisco"))) == 0 ? "" : "Non-", + (tvb_strneql(tvb, offset, "cisco", strlen("cisco"))) == 0 ? "" : "Non-", auth_buf); offset += 8; } diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c index ca4cbce901..29e9e3d0b9 100644 --- a/epan/dissectors/packet-mac-lte.c +++ b/epan/dissectors/packet-mac-lte.c @@ -849,7 +849,7 @@ static gboolean dissect_mac_lte_heur(tvbuff_t *tvb, packet_info *pinfo, } /* OK, compare with signature string */ - if (tvb_strneql(tvb, offset, MAC_LTE_START_STRING, (gint)strlen(MAC_LTE_START_STRING)) != 0) { + if (tvb_strneql(tvb, offset, MAC_LTE_START_STRING, strlen(MAC_LTE_START_STRING)) != 0) { return FALSE; } offset += (gint)strlen(MAC_LTE_START_STRING); diff --git a/epan/dissectors/packet-msrp.c b/epan/dissectors/packet-msrp.c index c7274b0fe8..81e1fc062e 100644 --- a/epan/dissectors/packet-msrp.c +++ b/epan/dissectors/packet-msrp.c @@ -49,7 +49,7 @@ #define TCP_PORT_MSRP 0 #define MSRP_HDR "MSRP" -#define MSRP_HDR_LEN ((gint) strlen (MSRP_HDR)) +#define MSRP_HDR_LEN (strlen (MSRP_HDR)) /* Initialize the protocol and registered fields */ static int proto_msrp = -1; diff --git a/epan/dissectors/packet-pdcp-lte.c b/epan/dissectors/packet-pdcp-lte.c index be5bc30467..1846f672d7 100644 --- a/epan/dissectors/packet-pdcp-lte.c +++ b/epan/dissectors/packet-pdcp-lte.c @@ -1413,7 +1413,7 @@ static gboolean dissect_pdcp_lte_heur(tvbuff_t *tvb, packet_info *pinfo, } /* OK, compare with signature string */ - if (tvb_strneql(tvb, offset, PDCP_LTE_START_STRING, (gint)strlen(PDCP_LTE_START_STRING)) != 0) { + if (tvb_strneql(tvb, offset, PDCP_LTE_START_STRING, strlen(PDCP_LTE_START_STRING)) != 0) { return FALSE; } offset += (gint)strlen(PDCP_LTE_START_STRING); diff --git a/epan/dissectors/packet-sap.c b/epan/dissectors/packet-sap.c index 757eb9dda3..9030d59a4e 100644 --- a/epan/dissectors/packet-sap.c +++ b/epan/dissectors/packet-sap.c @@ -203,7 +203,7 @@ dissect_sap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) auth_len, pad_len); return; } - + proto_tree_add_text(sa_tree, tvb, offset+1, auth_data_len-pad_len-1, "Authentication subheader: (%u byte%s)", @@ -230,7 +230,7 @@ dissect_sap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } /* Do we have the optional payload type aka. MIME content specifier */ - if (tvb_strneql(tvb, offset, "v=", (int)strlen("v="))) { + if (tvb_strneql(tvb, offset, "v=", strlen("v="))) { gint remaining_len; guint32 pt_len; int pt_string_len; diff --git a/epan/tvbuff.c b/epan/tvbuff.c index 7c2b6e6891..d2ee540faf 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -959,7 +959,7 @@ guint8_pbrk(const guint8* haystack, size_t haystacklen, const guint8 *needles, g { gchar tmp[256] = { 0 }; const guint8 *haystack_end; - + while (*needles) tmp[*needles++] = 1; @@ -1982,7 +1982,7 @@ tvb_strnlen(tvbuff_t *tvb, const gint offset, const guint maxlength) * it returns 0 (meaning "equal") and -1 otherwise, otherwise return -1. */ gint -tvb_strneql(tvbuff_t *tvb, const gint offset, const gchar *str, const gint size) +tvb_strneql(tvbuff_t *tvb, const gint offset, const gchar *str, const size_t size) { const guint8 *ptr; @@ -2572,7 +2572,7 @@ tvb_find_line_end(tvbuff_t *tvb, const gint offset, int len, gint *next_offset, /* * Is it a CR? - */ + */ if (found_needle == '\r') { /* * Yes - is it followed by an LF? diff --git a/epan/tvbuff.h b/epan/tvbuff.h index c3d059f07f..f5cbbe2313 100644 --- a/epan/tvbuff.h +++ b/epan/tvbuff.h @@ -617,7 +617,7 @@ extern gint tvb_skip_wsp_return(tvbuff_t* tvb, const gint offset); * it returns 0 (meaning "equal") and -1 otherwise, otherwise return -1. */ extern gint tvb_strneql(tvbuff_t *tvb, const gint offset, const gchar *str, - const gint size); + const size_t size); /** * Call g_ascii_strncasecmp after checking if enough chars left, returning |