From 1678b0a825b41c0beb5fdfe6d43543a03b294ac8 Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Sun, 23 Feb 2014 23:23:40 +0100 Subject: Remove deprecated TVB APIs Change-Id: I87216c3bd2061c12ce486c752d4381ab722db95e Reviewed-on: https://code.wireshark.org/review/328 Reviewed-by: Pascal Quantin --- epan/dissectors/packet-usb-com.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'epan/dissectors/packet-usb-com.c') diff --git a/epan/dissectors/packet-usb-com.c b/epan/dissectors/packet-usb-com.c index b9af854038..9c477de2b4 100644 --- a/epan/dissectors/packet-usb-com.c +++ b/epan/dissectors/packet-usb-com.c @@ -2,8 +2,6 @@ * Routines for USB Communications and CDC Control dissection * Copyright 2013, Pascal Quantin * - * $Id$ - * * Wireshark - Network traffic analyzer * By Gerald Combs * Copyright 1998 Gerald Combs @@ -343,7 +341,7 @@ dissect_usb_com_descriptor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, offset = 3; proto_tree_add_item(subtree, hf_usb_com_control_interface, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; - while (tvb_length_remaining(tvb,offset) > 0) { + while (tvb_reported_length_remaining(tvb,offset) > 0) { proto_tree_add_item(subtree, hf_usb_com_subordinate_interface, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; } @@ -361,10 +359,10 @@ dissect_usb_com_descriptor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, break; } - if (tvb_reported_length_remaining(tvb, offset) != 0) { + if (tvb_reported_length_remaining(tvb, offset) > 0) { proto_tree_add_item(subtree, hf_usb_com_descriptor_payload, tvb, offset, -1, ENC_NA); } - return tvb_length(tvb); + return tvb_captured_length(tvb); } static int @@ -540,7 +538,7 @@ dissect_usb_com_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi if (tvb_reported_length_remaining(tvb, offset) > 0) { proto_tree_add_item(subtree, hf_usb_com_control_payload, tvb, offset, -1, ENC_NA); } - return tvb_length(tvb); + return tvb_captured_length(tvb); } static int -- cgit v1.2.3