diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-02-19 23:17:07 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-02-19 23:17:07 +0000 |
commit | 29715ccc8f78d9a2f791437f49d6718615795c15 (patch) | |
tree | 36c72f6cae5e8e8ed09086eef9249eac9a65ca04 /epan/dissectors/packet-dis-pdus.c | |
parent | 5a5d872639a9e20893f82079af06f4caec980277 (diff) |
How can I get a new tvbuff that starts at an offset within a given
tvbuff and runs to the end of the tvbuff? Let me count the ways....
Replace a bunch of different ways of doing that (some incorrect, in that
they're not properly handling tvbuffs where the captured and reported
lengths are different) with tvb_new_subset_remaining().
svn path=/trunk/; revision=47751
Diffstat (limited to 'epan/dissectors/packet-dis-pdus.c')
-rw-r--r-- | epan/dissectors/packet-dis-pdus.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/epan/dissectors/packet-dis-pdus.c b/epan/dissectors/packet-dis-pdus.c index 717e3d358a..583179e7d4 100644 --- a/epan/dissectors/packet-dis-pdus.c +++ b/epan/dissectors/packet-dis-pdus.c @@ -865,10 +865,7 @@ gint parseFields(tvbuff_t *tvb, proto_tree *tree, gint offset, DIS_ParserNode pa break; case DIS_FIELDTYPE_RADIO_DATA: - newtvb = tvb_new_subset(tvb, offset, - tvb_length_remaining(tvb, offset), - tvb_reported_length_remaining(tvb, offset) - ); + newtvb = tvb_new_subset_remaining(tvb, offset); proto_tree_add_item(tree, hf_dis_signal_data, newtvb, 0, -1, ENC_NA ); /* ****ck******* need to look for padding bytes */ break; @@ -1029,10 +1026,7 @@ gint parseFields(tvbuff_t *tvb, proto_tree *tree, gint offset, DIS_ParserNode pa break; case DIS_FIELDTYPE_ANTENNA_PATTERN_PARAMETERS: /* just dump the bytes for now. Need to do finish */ - newtvb = tvb_new_subset(tvb, offset, - tvb_length_remaining(tvb, offset), - tvb_reported_length_remaining(tvb, offset) - ); + newtvb = tvb_new_subset_remaining(tvb, offset); proto_tree_add_item(tree, hf_dis_antenna_pattern_parameter_dump, newtvb, 0, -1, ENC_NA ); break; |