From 92896f46b8b9628c2f24d519cbfb205b6c1e20e3 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Fri, 2 Mar 2012 11:07:50 +0000 Subject: Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang svn path=/trunk/; revision=41312 --- epan/dissectors/packet-bittorrent.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'epan/dissectors/packet-bittorrent.c') diff --git a/epan/dissectors/packet-bittorrent.c b/epan/dissectors/packet-bittorrent.c index ee15317f50..02d15ab725 100644 --- a/epan/dissectors/packet-bittorrent.c +++ b/epan/dissectors/packet-bittorrent.c @@ -585,7 +585,6 @@ static void dissect_bittorrent_message (tvbuff_t *tvb, packet_info *pinfo, proto proto_item *ti; guint32 piece_index, piece_begin, piece_length; guint32 stringlen; - guint16 dht_port; if (tvb_bytes_exist(tvb, offset + BITTORRENT_HEADER_LENGTH, 1)) { /* Check for data from the middle of a message. */ @@ -695,8 +694,7 @@ static void dissect_bittorrent_message (tvbuff_t *tvb, packet_info *pinfo, proto case BITTORRENT_MESSAGE_PORT: /* port as payload */ - dht_port = tvb_get_ntohs(tvb, offset); - proto_tree_add_uint(mtree, hf_bittorrent_port, tvb, offset, 2, dht_port); offset += 2; + proto_tree_add_uint(mtree, hf_bittorrent_port, tvb, offset, 2, ENC_BIG_ENDIAN); break; case BITTORRENT_MESSAGE_EXTENDED: @@ -757,7 +755,7 @@ static void dissect_bittorrent_message (tvbuff_t *tvb, packet_info *pinfo, proto } } -static void dissect_bittorrent_welcome (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +static int dissect_bittorrent_welcome (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { int offset = 0; int i; @@ -787,6 +785,7 @@ static void dissect_bittorrent_welcome (tvbuff_t *tvb, packet_info *pinfo _U_, p } } offset += 20; + return offset; } static void dissect_bittorrent_tcp_pdu (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -- cgit v1.2.3