Wireshark-commits: [Wireshark-commits] master c43bd0d: Clean up the handling of the "friendly name"

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Fri, 19 Jul 2019 21:29:01 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=c43bd0def1aaf6db2febcd008d7e83021ef85427
Submitter: "Guy Harris <guy@xxxxxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

c43bd0d by Guy Harris (guy@xxxxxxxxxxxx):

    Clean up the handling of the "friendly name".
    
    Fetch it by adding it with proto_tree_add_item_ret_display_string(), and
    then use the resulting displayable string to append to columns and
    protocol tree items.  Given that the string in question is ISO 8859-1,
    according to the KNXnet/IP spec, and that it must therefore be converted
    to UTF-8, that's the right thing to do.
    
    Use wmem string buffers to hold the strings to append - using a
    fixed-length buffer isn't a good idea when you are dealing with UTF-8
    strings, as you might cut a UTF-8 sequence short in the middle.
    
    Don't consruct strings that we never use.
    
    While we're at it, give a URL to find KNX specifications.
    
    Change-Id: Ibec4f6c83a62e141bd8ce0e5dfd7dd45ff627fe4
    Reviewed-on: https://code.wireshark.org/review/34024
    Petri-Dish: Guy Harris <guy@xxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    

Actions performed:

    from  3707fd0   Use proto_tree_add_item_ret_display_string() to add string items.
     add  c43bd0d   Clean up the handling of the "friendly name".


Summary of changes:
 epan/dissectors/packet-knxip.c | 128 ++++++++++++++++-------------------------
 1 file changed, 51 insertions(+), 77 deletions(-)