Wireshark-commits: [Wireshark-commits] master-3.0 50a6a1c: Clean up some issues with get_iface_list
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=50a6a1cd8159d803fae4a0bff2d9e539eb30a828
Submitter: "Guy Harris <gharris@xxxxxxxxx>"
Changed: branch: master-3.0
Repository: wireshark
Commits:
50a6a1c by Guy Harris (guy@xxxxxxxxxxxx):
Clean up some issues with get_iface_list_string().
Remove an assignment of NULL to a variable when it's in a branch of code
where the variable's already known to be NULL. Found by PVS-Studio.
Pull get_display_name_for_interface() into the one place it's used.
That:
allows us to eliminate a test as, inside the loop where it's called,
the loop index is what's passed to it, and the loop tests whether
it's in range, so the test will never fail;
means we just set interface_opts once, for both of the places it's
used.
Then we fix that code so that it sets interface_opts->descr to a
generated descriptive name if it *is* null, rather than if it's *not*
null.
That should clean up some issues found by 1) PVS-Studio and 2) me.
Change-Id: I4188ca8f5c7306477ef11117016691d1c9f0267f
Reviewed-on: https://code.wireshark.org/review/37082
Petri-Dish: Guy Harris <gharris@xxxxxxxxx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@xxxxxxxxx>
(cherry picked from commit bd963200cef84df076af8e8b169fc9af0edbd2d8)
Reviewed-on: https://code.wireshark.org/review/37084
Actions performed:
from 49c7d78 pcapng: show some fields in decimal, not hexadecimal.
add 50a6a1c Clean up some issues with get_iface_list_string().
Summary of changes:
ui/capture_ui_utils.c | 43 +++++++++++++------------------------------
1 file changed, 13 insertions(+), 30 deletions(-)