Wireshark-commits: [Wireshark-commits] master-3.2 0f845c6: Clean up some issues with get_iface_list

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sun, 03 May 2020 20:45:47 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=0f845c6650fd4037d8504f7e95351aa948088920
Submitter: "Guy Harris <gharris@xxxxxxxxx>"
Changed: branch: master-3.2
Repository: wireshark

Commits:

0f845c6 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 5cbef3115e66f13e82ff9340155777d1e6699057)
    Reviewed-on: https://code.wireshark.org/review/37083
    

Actions performed:

    from  43b7f54   pcapng: show some fields in decimal, not hexadecimal.
     add  0f845c6   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(-)