aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2018-08-09 16:42:00 +0200
committerPeter Wu <peter@lekensteyn.nl>2018-08-09 15:18:06 +0000
commit28b7adfadccc1f5a07cfc3f0466fea1d42e18f12 (patch)
tree9e0ca1ad628db2494b647b52426a5c4dd758a4ca /epan/proto.c
parentc4d76452d3134ae03e2508471a5c659c77bf7316 (diff)
proto.c: allow more field types for proto_tree_add_item_ret_uint64()
Let's make the function accept FT_UINT40, FT_UINT48 and FT_UINT56 types. Ping-Bug: 15050 Change-Id: I35440a7c0b9cbf25bd8d903c425b6026d6a987f0 Reviewed-on: https://code.wireshark.org/review/29044 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'epan/proto.c')
-rw-r--r--epan/proto.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/epan/proto.c b/epan/proto.c
index d92366a3cd..602fff4011 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -3023,8 +3023,14 @@ proto_tree_add_item_ret_uint64(proto_tree *tree, int hfindex, tvbuff_t *tvb,
DISSECTOR_ASSERT_HINT(hfinfo != NULL, "Not passed hfi!");
- if (hfinfo->type != FT_UINT64) {
- REPORT_DISSECTOR_BUG("field %s is not of type FT_UINT64",
+ switch (hfinfo->type) {
+ case FT_UINT40:
+ case FT_UINT48:
+ case FT_UINT56:
+ case FT_UINT64:
+ break;
+ default:
+ REPORT_DISSECTOR_BUG("field %s is not of type FT_UINT40, FT_UINT48, FT_UINT56, or FT_UINT64",
hfinfo->abbrev);
}