if (hf_index != -1) {
hfinfo = proto_registrar_get_nth(hf_index);
- if (hfinfo && count != 1 &&
- (hfinfo->type == FT_INT8 || hfinfo->type == FT_UINT8)) {
+ if (hfinfo && count != 1 &&
+ (hfinfo->type == FT_INT8 || hfinfo->type == FT_UINT8)
+ && count != 1) {
THROW(ReportedBoundsError);
}
proto_tree_add_item(tree, hf_index, tvb, offset, count, TRUE);
offset += count;
items++;
} else {
- if (items->type == PARAM_WORD && count != 2 ||
- items->type == PARAM_DWORD && count != 4) {
- THROW(ReportedBoundsError);
- }
offset = (*items->func)(tvb, offset, count,
pinfo, tree, 0, *items->hf_index);
items++;
offset += count;
items++;
} else {
- if (items->type == PARAM_WORD && count != 2 ||
- items->type == PARAM_DWORD && count != 4) {
- THROW(ReportedBoundsError);
- }
offset = (*items->func)(tvb, offset, count,
pinfo, tree, 0, *items->hf_index);
items++;
offset += count;
items++;
} else {
- if (items->type == PARAM_WORD && count != 2 ||
- items->type == PARAM_DWORD && count != 4) {
- THROW(ReportedBoundsError);
- }
offset = (*items->func)(tvb, offset, count,
pinfo, tree, convert, *items->hf_index);
items++;
tvb_bytes_to_str(tvb, cptr, count));
items++;
} else {
- if (items->type == PARAM_WORD && count != 2 ||
- items->type == PARAM_DWORD && count != 4) {
- THROW(ReportedBoundsError);
- }
offset = (*items->func)(tvb, offset, count,
pinfo, tree, convert, *items->hf_index);
items++;