HL7: fix missing struct initialization spotted by Clang Static Analyzer

Change-Id: Icb3e924f48b8fa00d7a39fcbdc4400ad2c4c2b89
Signed-off-by: Francesco Fondelli <francesco.fondelli@gmail.com>
Reviewed-on: https://code.wireshark.org/review/18163
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Francesco Fondelli 2016-10-12 11:19:55 +02:00 committed by Michael Mann
parent 9934fff4c0
commit 84cfd3bad6
1 changed files with 5 additions and 3 deletions

View File

@ -703,9 +703,13 @@ parse_msh(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset,
gint field_separator_offset = -1;
gint field_number = 0;
/* initialize msh */
msh->trigger_event[0] ='\0';
msh->message_type[0] = '\0';
/* e.g. MSH|^~\&|||||||XZY^IJK|||||||\r */
field_number = 1;
offset += 3; // skip MSH
offset += 3; // skip 'MSH'
msh->field_separator = tvb_get_guint8(tvb, offset);
offset += 1;
msh->component_separator = tvb_get_guint8(tvb, offset);
@ -771,8 +775,6 @@ parse_msh(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset,
ENC_ASCII|ENC_NA);
PROTO_ITEM_SET_HIDDEN(hidden_item);
}
} else {
msh->trigger_event[0] ='\0';
}
}
}