expert: Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang

Change-Id: Ib38b37223bb7fe134bb2022668287ddc4c9bacbe
Reviewed-on: https://code.wireshark.org/review/28214
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Alexis La Goutte 2018-06-12 08:17:54 +02:00 committed by Anders Broman
parent 7ca88cc629
commit 654ab0d96b
1 changed files with 2 additions and 6 deletions

View File

@ -641,9 +641,7 @@ proto_tree_add_expert_internal(proto_tree *tree, packet_info *pinfo, expert_fiel
va_end(unused);
/* But make sure it throws an exception *after* adding the item */
if (length == -1) {
length = tvb_captured_length(tvb) ? tvb_ensure_captured_length_remaining(tvb, start) : 0;
} else {
if (length != -1) {
tvb_ensure_bytes_exist(tvb, start, length);
}
return ti;
@ -684,9 +682,7 @@ proto_tree_add_expert_format(proto_tree *tree, packet_info *pinfo, expert_field
va_end(ap);
/* But make sure it throws an exception *after* adding the item */
if (length == -1) {
length = tvb_captured_length(tvb) ? tvb_ensure_captured_length_remaining(tvb, start) : 0;
} else {
if (length != -1) {
tvb_ensure_bytes_exist(tvb, start, length);
}
return ti;