diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2017-02-18 10:07:32 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-02-18 17:33:09 +0000 |
commit | 45a216eb526cfa976616d6a2bb393fcede7c8aa3 (patch) | |
tree | a8cfdf5cc0bfb26d3933657dd3ac9390e041fec5 /epan/dissectors/packet-roofnet.c | |
parent | 279dc61df158c52f436bc136d0fca6ec4f91c5d9 (diff) |
roofnet: always declare variable on the top
i known... not longer recommanded but i prefer
Change-Id: I0114202a2f1d7045524aa9fe254209c93d510b7d
Reviewed-on: https://code.wireshark.org/review/20169
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-roofnet.c')
-rw-r--r-- | epan/dissectors/packet-roofnet.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/epan/dissectors/packet-roofnet.c b/epan/dissectors/packet-roofnet.c index 5458fb27c3..c82930d744 100644 --- a/epan/dissectors/packet-roofnet.c +++ b/epan/dissectors/packet-roofnet.c @@ -118,6 +118,7 @@ static expert_field ei_roofnet_too_much_data = EI_INIT; */ static guint16 dissect_roofnet_header(proto_tree *tree, tvbuff_t *tvb, guint *offset) { + guint16 flags; ptvcursor_t *cursor = ptvcursor_new(tree, tvb, *offset); ptvcursor_add(cursor, hf_roofnet_version, 1, ENC_BIG_ENDIAN); @@ -128,7 +129,7 @@ static guint16 dissect_roofnet_header(proto_tree *tree, tvbuff_t *tvb, guint *of proto_tree_add_checksum(ptvcursor_tree(cursor), ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor), hf_roofnet_cksum, -1, NULL, NULL, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS); ptvcursor_advance(cursor, 2); - guint16 flags = tvb_get_ntohs(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); + flags = tvb_get_ntohs(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); proto_tree_add_bitmask(ptvcursor_tree(cursor), ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor), hf_roofnet_flags, ett_roofnet_flags, flag_list, ENC_BIG_ENDIAN); ptvcursor_advance(cursor, 2); @@ -223,6 +224,7 @@ static int dissect_roofnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 roofnet_msg_type = 0; guint8 roofnet_nlinks = 0; guint8 nlink = 1; + guint16 flags; col_set_str(pinfo->cinfo, COL_PROTOCOL, "Roofnet"); @@ -234,7 +236,7 @@ static int dissect_roofnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, it = proto_tree_add_item(tree, proto_roofnet, tvb, offset, -1, ENC_NA); roofnet_tree = proto_item_add_subtree(it, ett_roofnet); - guint16 flags = dissect_roofnet_header(roofnet_tree, tvb, &offset); + flags = dissect_roofnet_header(roofnet_tree, tvb, &offset); roofnet_nlinks = tvb_get_guint8(tvb, ROOFNET_OFFSET_NLINKS); /* Check that we do not have a malformed roofnet packet */ |