summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-wap.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-wap.c')
-rw-r--r--epan/dissectors/packet-wap.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/epan/dissectors/packet-wap.c b/epan/dissectors/packet-wap.c
index 1384f02b..6f747294 100644
--- a/epan/dissectors/packet-wap.c
+++ b/epan/dissectors/packet-wap.c
@@ -32,32 +32,32 @@
* XXX This seems to be used exclusively for fetching size values. We should
* probably rename this to wap_get_checked_size or something along those lines.
*/
-#define MAX_WAP_GUINTVAR (100 * 1000 * 1000) // Arbitrary. We need a large number that won't overflow a guint.
-guint
-tvb_get_guintvar (tvbuff_t *tvb, guint offset,
- guint *octetCount, packet_info *pinfo, expert_field *ei)
+#define MAX_WAP_UINTVAR (100 * 1000 * 1000) // Arbitrary. We need a large number that won't overflow a unsigned.
+unsigned
+tvb_get_uintvar (tvbuff_t *tvb, unsigned offset,
+ unsigned *octetCount, packet_info *pinfo, expert_field *ei)
{
- guint value = 0, previous_value;
- guint octet;
- guint counter = 0;
+ unsigned value = 0, previous_value;
+ unsigned octet;
+ unsigned counter = 0;
#ifdef DEBUG
fprintf (stderr,
- "dissect_wap: Starting tvb_get_guintvar at offset %d\n", offset);
+ "dissect_wap: Starting tvb_get_uintvar at offset %d\n", offset);
#endif
do {
- octet = tvb_get_guint8 (tvb, offset+counter);
+ octet = tvb_get_uint8 (tvb, offset+counter);
counter++;
previous_value = value;
value <<= 7; /* Value only exists in 7 of the 8 bits */
value += (octet & 0x7F);
- if (value < previous_value || value > MAX_WAP_GUINTVAR) {
+ if (value < previous_value || value > MAX_WAP_UINTVAR) {
/* overflow; clamp the value at UINT_MAX */
proto_tree_add_expert(NULL, pinfo, ei, tvb, offset, counter);
- value = MAX_WAP_GUINTVAR;
+ value = MAX_WAP_UINTVAR;
break;
}
@@ -70,7 +70,7 @@ tvb_get_guintvar (tvbuff_t *tvb, guint offset,
#ifdef DEBUG
fprintf (stderr,
- "dissect_wap: Leaving tvb_get_guintvar count=%d, value=%u\n",
+ "dissect_wap: Leaving tvb_get_uintvar count=%d, value=%u\n",
counter, value);
#endif