diff --git a/epan/dvb_chartbl.c b/epan/dvb_chartbl.c index d1662d2341..69886e9c88 100644 --- a/epan/dvb_chartbl.c +++ b/epan/dvb_chartbl.c @@ -284,7 +284,7 @@ dvb_add_chartbl(proto_tree *tree, int hf, if (length==0) { proto_item *pi; - pi = proto_tree_add_text(tree, NULL, 0, 0, + pi = proto_tree_add_bytes_format(tree, hf, tvb, 0, 0, NULL, "Default character table (Latin)"); PROTO_ITEM_SET_GENERATED(pi); } diff --git a/epan/tpg.h b/epan/tpg.h index ce40fee313..d4065c0a81 100644 --- a/epan/tpg.h +++ b/epan/tpg.h @@ -75,8 +75,7 @@ WS_DLL_PUBLIC guint8* tpg_ipv6(tvbparse_elem_t*); #define TPG_ADD_UINT(tpg, hfid, elem, value) proto_tree_add_uint(ep_stack_peek(((tpg_parser_data_t*)tpg)->stack), hfid, (elem)->tvb, (elem)->offset, (elem)->len, value) #define TPG_ADD_IPV4(tpg, hfid, elem, value) proto_tree_add_ipv4(ep_stack_peek(((tpg_parser_data_t*)tpg)->stack), hfid, (elem)->tvb, (elem)->offset, (elem)->len, value) #define TPG_ADD_IPV6(tpg, hfid, elem, value) proto_tree_add_ipv6(ep_stack_peek(((tpg_parser_data_t*)tpg)->stack), hfid, (elem)->tvb, (elem)->offset, (elem)->len, value) -#define TPG_ADD_TEXT(tpg, elem) proto_tree_add_text(ep_stack_peek(((tpg_parser_data_t*)tpg)->stack), (elem)->tvb, (elem)->offset, (elem)->len, \ - "%s",tvb_format_text((elem)->tvb, (elem)->offset, (elem)->len)) +#define TPG_ADD_TEXT(tpg, elem) proto_tree_add_format_text(ep_stack_peek(((tpg_parser_data_t*)tpg)->stack), (elem)->tvb, (elem)->offset, (elem)->len) #define TPG_SET_TEXT(pi, elem) proto_item_set_text((pi), "%s",tvb_format_text((elem)->tvb, (elem)->offset, (elem)->len)) diff --git a/epan/tvbparse.c b/epan/tvbparse.c index 884fb08114..4f400597ff 100644 --- a/epan/tvbparse.c +++ b/epan/tvbparse.c @@ -1366,7 +1366,7 @@ void tvbparse_tree_add_elem(proto_tree* tree, tvbparse_elem_t* curr) { frame->elem = curr; while (curr) { - pi = proto_tree_add_text(frame->tree,curr->tvb,curr->offset,curr->len,"%s",tvb_format_text(curr->tvb,curr->offset,curr->len)); + pi = proto_tree_add_format_text(frame->tree,curr->tvb,curr->offset,curr->len); if(curr->sub) { frame->elem = curr; diff --git a/ui/gtk/main.c b/ui/gtk/main.c index cf6e829a05..721f942e53 100644 --- a/ui/gtk/main.c +++ b/ui/gtk/main.c @@ -874,7 +874,7 @@ tree_view_selection_changed_cb(GtkTreeSelection *sel, gpointer user_data _U_) } else { /* * Don't show anything if the field name is zero-length; - * the pseudo-field for "proto_tree_add_text()" is such + * the pseudo-field for text-only items is such * a field, and we don't want "Text (text)" showing up * on the status line if you've selected such a field. * @@ -886,10 +886,9 @@ tree_view_selection_changed_cb(GtkTreeSelection *sel, gpointer user_data _U_) * but we'd have to add checks for null pointers in some * places if we did that. * - * Or perhaps protocol tree items added with - * "proto_tree_add_text()" should have -1 as the field index, - * with no pseudo-field being used, but that might also - * require special checks for -1 to be added. + * Or perhaps text-only items should have -1 as the field + * index, with no pseudo-field being used, but that might + * also require special checks for -1 to be added. */ statusbar_push_field_msg("%s", ""); } diff --git a/ui/qt/proto_tree.cpp b/ui/qt/proto_tree.cpp index 961cf577e0..20f1e0e8e5 100644 --- a/ui/qt/proto_tree.cpp +++ b/ui/qt/proto_tree.cpp @@ -392,7 +392,7 @@ void ProtoTree::updateSelectionStatus(QTreeWidgetItem* item) { } // else the GTK+ version pushes an empty string as described below. /* * Don't show anything if the field name is zero-length; - * the pseudo-field for "proto_tree_add_text()" is such + * the pseudo-field for text-only items is such * a field, and we don't want "Text (text)" showing up * on the status line if you've selected such a field. * @@ -404,10 +404,9 @@ void ProtoTree::updateSelectionStatus(QTreeWidgetItem* item) { * but we'd have to add checks for null pointers in some * places if we did that. * - * Or perhaps protocol tree items added with - * "proto_tree_add_text()" should have -1 as the field index, - * with no pseudo-field being used, but that might also - * require special checks for -1 to be added. + * Or perhaps text-only items should have -1 as the field + * index, with no pseudo-field being used, but that might + * also require special checks for -1 to be added. */ } else {