aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2013-01-29 22:15:06 +0000
committerMartin Kaiser <wireshark@kaiser.cx>2013-01-29 22:15:06 +0000
commit4a64d511192b93a62e225b0b56cd0d8c1821e745 (patch)
treeab5243a15b44ca962deee4b7f2996fef5aa550ea
parentb3f2e26a7a5454193d645e1a3cc0def5e84f7fab (diff)
simplify dissect_gds() a bit
svn path=/trunk/; revision=47360
-rw-r--r--epan/dissectors/packet-sna.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/epan/dissectors/packet-sna.c b/epan/dissectors/packet-sna.c
index 4bb0480522..e2e842ed43 100644
--- a/epan/dissectors/packet-sna.c
+++ b/epan/dissectors/packet-sna.c
@@ -2512,14 +2512,11 @@ dissect_gds(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint16 length;
guint16 type;
int cont;
- int offset;
+ int offset = 0;
proto_tree *gds_tree;
proto_item *gds_item;
- offset = 0;
- cont = 1;
-
- while (cont) {
+ do {
length = tvb_get_ntohs(tvb, offset) & 0x7fff;
cont = (tvb_get_ntohs(tvb, offset) & 0x8000) ? 1 : 0;
type = tvb_get_ntohs(tvb, offset+2);
@@ -2540,7 +2537,7 @@ dissect_gds(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset+2, 2, type);
}
offset += length;
- }
+ } while(cont);
if (tvb_offset_exists(tvb, offset))
call_dissector(data_handle,
tvb_new_subset_remaining(tvb, offset), pinfo, parent_tree);