diff options
author | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2020-05-04 22:49:12 +0100 |
---|---|---|
committer | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2020-05-06 08:35:11 +0000 |
commit | a5703f22cb723c46d5700cf3fffc8a9b40dd47d3 (patch) | |
tree | ee7bb5e4a9cb3b4410519f68aad207ce2b01356e /ui | |
parent | 1d0b233f12e937f6278fc38775fca530e2be2661 (diff) |
More changes arising from PVS-Studio output.
/opt/SourceCode/wireshark/epan/dissectors/packet-ip.c 1556 err V547 Expression 'opt == (1 | 0x00)' is always true.
/opt/SourceCode/wireshark/epan/dissectors/packet-ipdc.c 739 warn V547 Expression 'payload_len < 4' is always false.
/opt/SourceCode/wireshark/ui/text_import.c 1049 err V547 Expression 'info->offset_type == OFFSET_DEC' is always true.
None of these are actual bugfixes.
Bug: 16335
Change-Id: I6d0d3bb92c70ea625fc8b559e7a2bc5ba4e29e25
Reviewed-on: https://code.wireshark.org/review/37136
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/text_import.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/ui/text_import.c b/ui/text_import.c index d3eca3b668..bc3f146a9a 100644 --- a/ui/text_import.c +++ b/ui/text_import.c @@ -1043,11 +1043,21 @@ text_import(text_import_info_t *info) hdr_data_chunk = FALSE; hdr_export_pdu = FALSE; - offset_base = (info->offset_type == OFFSET_NONE) ? 0 : - (info->offset_type == OFFSET_HEX) ? 16 : - (info->offset_type == OFFSET_OCT) ? 8 : - (info->offset_type == OFFSET_DEC) ? 10 : - 16; + switch (info->offset_type) + { + case OFFSET_NONE: + offset_base = 0; + break; + case OFFSET_HEX: + offset_base = 16; + break; + case OFFSET_OCT: + offset_base = 8; + break; + case OFFSET_DEC: + offset_base = 10; + break; + } has_direction = info->has_direction; |