ansi_a: fix this condition has identical branches [-Werror=duplicated-branches] found by gcc7

All users of the ELEM_OPT_TLV and ELEM_MAND_TV macros pass an empty string ("")
for the elem_name_addition parameter, so it can never be NULL. The Coverity
warning was about a superfluous check (elem_name_addition[0]=='\0'). All of
these checks are superfluous anyway since both branches yield an empty string.

Change-Id: I28c994fd5e10c04f99c8d77e9aee18afd4a26412
Reviewed-on: https://code.wireshark.org/review/20427
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
This commit is contained in:
Alexis La Goutte 2017-03-06 21:05:06 +01:00 committed by Peter Wu
parent ae39d9ad13
commit c8020c7f62
1 changed files with 2 additions and 4 deletions

View File

@ -7510,8 +7510,7 @@ elem_v(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, elem_idx_t idx, guin
"Missing Mandatory element (0x%02x) %s%s, rest of dissection is suspect", \
ansi_a_elem_1_strings[elem_idx].value, \
ansi_a_elem_1_strings[elem_idx].strptr, \
/* coverity[array_null] */ \
(elem_name_addition == NULL) ? "" : elem_name_addition \
elem_name_addition \
); \
} \
if (curr_len <= 0) return; \
@ -7541,8 +7540,7 @@ elem_v(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, elem_idx_t idx, guin
"Missing Mandatory element (0x%02x) %s%s, rest of dissection is suspect", \
ansi_a_elem_1_strings[elem_idx].value, \
ansi_a_elem_1_strings[elem_idx].strptr, \
/* coverity[array_null] */ \
(elem_name_addition == NULL) ? "" : elem_name_addition \
elem_name_addition \
); \
} \
if (curr_len <= 0) return; \