For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.
[obnox/wireshark/wip.git] / epan / dissectors / packet-dtpt.c
index bcd99bac4078e627c7eb4364c314ec4ead79e7d0..3a488e097cb4dc60ae92ac33eafa292bdf8cf862 100644 (file)
@@ -410,7 +410,6 @@ static int
 dissect_dtpt_conversation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
        guint           offset = 0;
-       guint           rest_length;
 
        /* First try to decode it as "normal" DTPT packets. */
        offset = dissect_dtpt(tvb, pinfo, tree);
@@ -420,14 +419,11 @@ dissect_dtpt_conversation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                offset = dissect_dtpt_data(tvb, pinfo, tree);
        }
 
-       /* Handle the rest ... */
-       rest_length = tvb_reported_length(tvb) - offset;
-       if (rest_length > 0) {
-               tvbuff_t        *next_tvb;
+       /* Handle any remaining bytes ... */
+       if (tvb_reported_length_remaining(tvb, offset) > 0) {
                /* ... as data. */
                call_dissector(data_handle,
                        tvb_new_subset_remaining(tvb, offset), pinfo, tree);
-               next_tvb = tvb_new_subset(tvb, offset, rest_length, rest_length);
        }
        return tvb_reported_length(tvb);
 }
@@ -464,7 +460,7 @@ dissect_dtpt_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
        if (tree) {
                dtpt_item = proto_tree_add_item(tree, proto_dtpt,
-                               tvb, 0, -1, FALSE);
+                               tvb, 0, -1, ENC_NA);
                if (dtpt_item)
                        dtpt_tree = proto_item_add_subtree(dtpt_item, ett_dtpt);
        }
@@ -738,7 +734,7 @@ dissect_dtpt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
        if (tree) {
                dtpt_item = proto_tree_add_item(tree, proto_dtpt,
-                               tvb, 0, -1, FALSE);
+                               tvb, 0, -1, ENC_NA);
                if (dtpt_item)
                        dtpt_tree = proto_item_add_subtree(dtpt_item, ett_dtpt);
        }