forked from osmocom/wireshark
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>
This commit is contained in:
parent
7b2d8a16c5
commit
ca57399db8
11
epan/proto.c
11
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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue