aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ansi_a.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2011-02-17 19:43:16 +0000
committerGerald Combs <gerald@wireshark.org>2011-02-17 19:43:16 +0000
commit1b0516a27ea33e0b91f824248a8797f02b6af047 (patch)
tree969f03666b78e41767f358fbf15cc07c01ab0bf4 /epan/dissectors/packet-ansi_a.c
parent51e5e75373ed9886e5b311cb6db6dd3a09b0df03 (diff)
Fix various Visual C++ analysis warnings.
svn path=/trunk/; revision=35985
Diffstat (limited to 'epan/dissectors/packet-ansi_a.c')
-rw-r--r--epan/dissectors/packet-ansi_a.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/epan/dissectors/packet-ansi_a.c b/epan/dissectors/packet-ansi_a.c
index 8c53450973..14f81191a8 100644
--- a/epan/dissectors/packet-ansi_a.c
+++ b/epan/dissectors/packet-ansi_a.c
@@ -657,7 +657,7 @@ static int proto_a_dtap = -1;
const ext_value_string_t *ansi_a_bsmap_strings = NULL;
const ext_value_string_t *ansi_a_dtap_strings = NULL;
const ext_value_string_t *ansi_a_elem_1_strings = NULL;
-static guint ansi_a_elem_1_max = 0;
+static gint ansi_a_elem_1_max = 0;
static int ansi_a_tap = -1;
@@ -8729,7 +8729,7 @@ elem_tlv(tvbuff_t *tvb, proto_tree *tree, elem_idx_t idx, guint32 offset, guint
curr_offset = offset;
consumed = 0;
- if ((unsigned) idx >= ansi_a_elem_1_max-1)
+ if (idx < 0 || idx >= ansi_a_elem_1_max-1)
{
/* Unknown index, skip the element */
return tvb_length_remaining(tvb, offset) ;
@@ -8812,7 +8812,7 @@ elem_tv(tvbuff_t *tvb, proto_tree *tree, elem_idx_t idx, guint32 offset, const g
curr_offset = offset;
consumed = 0;
- if ((unsigned) idx >= ansi_a_elem_1_max-1)
+ if (idx < 0 || idx >= ansi_a_elem_1_max-1)
{
/* Unknown index, skip the element */
return tvb_length_remaining(tvb, offset) ;
@@ -8886,7 +8886,7 @@ elem_t(tvbuff_t *tvb, proto_tree *tree, elem_idx_t idx, guint32 offset, const gc
curr_offset = offset;
consumed = 0;
- if ((unsigned)idx >= ansi_a_elem_1_max-1)
+ if (idx < 0 || idx >= ansi_a_elem_1_max-1)
{
/* Unknown index, skip the element */
return tvb_length_remaining(tvb, offset) ;
@@ -8924,7 +8924,7 @@ elem_lv(tvbuff_t *tvb, proto_tree *tree, elem_idx_t idx, guint32 offset, guint l
curr_offset = offset;
consumed = 0;
- if ((unsigned) idx >= ansi_a_elem_1_max-1)
+ if (idx < 0 || idx >= ansi_a_elem_1_max-1)
{
/* Unknown index, skip the element */
return tvb_length_remaining(tvb, offset) ;
@@ -8992,7 +8992,7 @@ elem_v(tvbuff_t *tvb, proto_tree *tree, elem_idx_t idx, guint32 offset)
curr_offset = offset;
consumed = 0;
- if ((unsigned) idx >= ansi_a_elem_1_max-1)
+ if (idx < 0 || idx >= ansi_a_elem_1_max-1)
{
/* Unknown index, skip the element */
return tvb_length_remaining(tvb, offset) ;
@@ -11614,7 +11614,7 @@ dissect_cdma2000_a1_elements(tvbuff_t *tvb, _U_ packet_info *pinfo, proto_tree *
guint32 curr_offset;
guint32 consumed;
guint curr_len;
- guint idx;
+ gint idx;
guint8 oct;
curr_offset = offset;