diff options
author | Michael Mann <mmann78@netscape.net> | 2016-12-15 13:01:27 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-12-16 03:04:11 +0000 |
commit | 232cb9a2dd87ea9cc9c88d4c32bfb7b452705130 (patch) | |
tree | ff1b2039727322c1f8e332f2040f0ba5d83c4f43 /epan/dissectors/packet-xip-serval.c | |
parent | 8efb7fece1ffefd26dacd79f5ec8722c4e01e827 (diff) |
Remove proto_item_append_text calls in favor of BASE_UNIT_STRING.
Many proto_item_append_text calls were just adding a unit string to a field.
There's a better way to do that now.
Change-Id: Id18d5ac1ea4d8ecdc4cbe7ebaec07fbd2eab6e78
Reviewed-on: https://code.wireshark.org/review/19289
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-xip-serval.c')
-rw-r--r-- | epan/dissectors/packet-xip-serval.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/epan/dissectors/packet-xip-serval.c b/epan/dissectors/packet-xip-serval.c index b8f458dd6c..5a75939e1d 100644 --- a/epan/dissectors/packet-xip-serval.c +++ b/epan/dissectors/packet-xip-serval.c @@ -120,9 +120,8 @@ display_xip_serval_control_ext(tvbuff_t *tvb, proto_tree *xip_serval_tree, offset++; /* Add XIP Serval extension length. */ - ti = proto_tree_add_item(cext_tree, hf_xip_serval_ext_length, tvb, + proto_tree_add_item(cext_tree, hf_xip_serval_ext_length, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_item_append_text(ti, " bytes"); offset++; /* Create XIP Serval Control Extension flags tree. */ @@ -198,7 +197,6 @@ display_xip_serval(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Add XIP Serval header length. */ hl_ti = proto_tree_add_item(xip_serval_tree, hf_xip_serval_hl, tvb, XSRVL_LEN, 1, ENC_BIG_ENDIAN); - proto_item_append_text(hl_ti, " bytes"); if (tvb_captured_length(tvb) < xsh_len) expert_add_info_format(pinfo, hl_ti, &ei_xip_serval_bad_len, "Header Length field (%d bytes) cannot be greater than actual number of bytes left in packet (%d bytes)", @@ -284,7 +282,7 @@ proto_register_xip_serval(void) { &hf_xip_serval_hl, { "Header Length", "xip_serval.hl", FT_UINT8, - BASE_DEC, NULL, 0x0, NULL, HFILL }}, + BASE_DEC|BASE_UNIT_STRING, &units_byte_bytes, 0x0, NULL, HFILL }}, { &hf_xip_serval_proto, { "Protocol", "xip_serval.proto", FT_UINT8, @@ -306,7 +304,7 @@ proto_register_xip_serval(void) { &hf_xip_serval_ext_length, { "Extension Length", "xip_serval.ext_length", FT_UINT8, - BASE_DEC, NULL, 0x0, NULL, HFILL }}, + BASE_DEC|BASE_UNIT_STRING, &units_byte_bytes, 0x0, NULL, HFILL }}, /* Serval Control Extension Header. */ |