Wireshark-bugs: [Wireshark-bugs] [Bug 5270] diff for a new dissector for COAP (draft-ietf-core-c
Date: Sat, 23 Jul 2011 09:06:18 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5270

--- Comment #49 from Alexis La Goutte <alexis.lagoutte@xxxxxxxxx> 2011-07-23 09:06:15 PDT ---
(In reply to comment #48)
> - improved the option handler.

I prefer when there is a switch with case (more readable) 

otherwise
There is 2 errors with checkhf 
ERROR: NO ARRAY: epan/dissectors/packet-coap.c, hf_coap_opt_block2
ERROR: NO ARRAY: epan/dissectors/packet-coap.c, hf_coap_opt_block1


+static void
+dissect_coap_opt_port(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree,
gint offset, gint opt_length, int hfindex)
+{
+    proto_item *item = NULL;
+
+    if (opt_length > 2) {
+        proto_tree_add_text(subtree, tvb, 0, 0, "Invalid length: %d",
opt_length);
+        return;
+    }

Why not use expert_info to display this error ?

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.