diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-04-25 17:41:49 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-04-26 00:42:32 +0000 |
commit | ca57399db89b69a9ae8517f3e0ef530855c354bd (patch) | |
tree | c22b8fd976a86746b846318e74d15c294440d64a /epan/proto.c | |
parent | 7b2d8a16c58b9a6a826f2df0f95a5504750493ed (diff) | |
download | wireshark-ca57399db89b69a9ae8517f3e0ef530855c354bd.tar.gz |
Get rid of duplicate code.
Use CHECK_FOR_NULL_TREE() while we're at it, to make it more like other
routines.
Change-Id: I2cbdf9f043583fd0c9858e94ae1134173a68c875
Reviewed-on: https://code.wireshark.org/review/15116
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/proto.c')
-rw-r--r-- | epan/proto.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/epan/proto.c b/epan/proto.c index 7dd5ccaf54..2a1d142b57 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -2443,18 +2443,11 @@ ptvcursor_add(ptvcursor_t *ptvc, int hfindex, gint length, get_hfi_length(hfinfo, ptvc->tvb, offset, &length, &item_length); test_length(hfinfo, ptvc->tvb, offset, item_length); - if (!ptvc->tree) { - ptvc->offset += get_full_length(hfinfo, ptvc->tvb, offset, - length, item_length, encoding); - return NULL; - } - - offset = ptvc->offset; - PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo); - get_hfi_length(hfinfo, ptvc->tvb, offset, &length, &item_length); ptvc->offset += get_full_length(hfinfo, ptvc->tvb, offset, length, item_length, encoding); + CHECK_FOR_NULL_TREE(ptvc->tree); + /* Coast clear. Try and fake it */ TRY_TO_FAKE_THIS_ITEM(ptvc->tree, hfindex, hfinfo); |