aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-pvfs2.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-pvfs2.c')
-rw-r--r--epan/dissectors/packet-pvfs2.c40
1 files changed, 18 insertions, 22 deletions
diff --git a/epan/dissectors/packet-pvfs2.c b/epan/dissectors/packet-pvfs2.c
index 16e9bff1e1..563ed38082 100644
--- a/epan/dissectors/packet-pvfs2.c
+++ b/epan/dissectors/packet-pvfs2.c
@@ -1147,11 +1147,12 @@ int dissect_pvfs_uint64(tvbuff_t *tvb, proto_tree *tree, int offset,
static int
dissect_pvfs_distribution(tvbuff_t *tvb, proto_tree *tree, int offset)
{
- proto_item *dist_item = NULL;
- proto_tree *dist_tree = NULL;
- guint32 distlen = 0;
- char *tmpstr = NULL;
+ proto_item *dist_item;
+ proto_tree *dist_tree;
+ guint32 distlen;
+ char *tmpstr;
guint8 issimplestripe = 0;
+ guint32 total_len;
/* Get distribution name length */
distlen = tvb_get_letohl(tvb, offset);
@@ -1159,28 +1160,23 @@ dissect_pvfs_distribution(tvbuff_t *tvb, proto_tree *tree, int offset)
/* Get distribution name */
tmpstr = (char *) tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 4, distlen, ENC_ASCII);
- if (tree)
- {
- guint32 total_len;
-
- /* 'distlen' does not include the NULL terminator */
- total_len = roundup8(4 + distlen + 1);
-
- if (((distlen + 1) == PVFS_DIST_SIMPLE_STRIPE_NAME_SIZE) &&
- (g_ascii_strncasecmp(tmpstr, PVFS_DIST_SIMPLE_STRIPE_NAME,
- distlen) == 0))
- {
- /* Parameter for 'simple_stripe' is 8 bytes */
- total_len += 8;
+ /* 'distlen' does not include the NULL terminator */
+ total_len = roundup8(4 + distlen + 1);
- issimplestripe = 1;
- }
+ if (((distlen + 1) == PVFS_DIST_SIMPLE_STRIPE_NAME_SIZE) &&
+ (g_ascii_strncasecmp(tmpstr, PVFS_DIST_SIMPLE_STRIPE_NAME,
+ distlen) == 0))
+ {
+ /* Parameter for 'simple_stripe' is 8 bytes */
+ total_len += 8;
- dist_item = proto_tree_add_string(tree, hf_pvfs_distribution, tvb, offset,
- total_len + 8, tmpstr);
- dist_tree = proto_item_add_subtree(dist_item, ett_pvfs_distribution);
+ issimplestripe = 1;
}
+ dist_item = proto_tree_add_string(tree, hf_pvfs_distribution,
+ tvb, offset, total_len + 8, tmpstr);
+ dist_tree = proto_item_add_subtree(dist_item, ett_pvfs_distribution);
+
/* io_dist */
offset = dissect_pvfs_string(tvb, dist_tree, hf_pvfs_io_dist, offset,
NULL);