mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
parser: initialize picture variable
When parsing "event 123" (?) a picture is added, without initializing the picture structure. Thus, a picture with a random gps location is added. Use the "empty_picture" initializer to avoid that. Fixes a Coverity warning. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
d1c89a55e1
commit
5ba6db80cc
1 changed files with 1 additions and 1 deletions
|
@ -114,7 +114,7 @@ void event_end(struct parser_state *state)
|
||||||
{
|
{
|
||||||
struct divecomputer *dc = get_dc(state);
|
struct divecomputer *dc = get_dc(state);
|
||||||
if (state->cur_event.type == 123) {
|
if (state->cur_event.type == 123) {
|
||||||
struct picture pic;
|
struct picture pic = empty_picture;
|
||||||
pic.filename = strdup(state->cur_event.name);
|
pic.filename = strdup(state->cur_event.name);
|
||||||
/* theoretically this could fail - but we didn't support multi year offsets */
|
/* theoretically this could fail - but we didn't support multi year offsets */
|
||||||
pic.offset.seconds = state->cur_event.time.seconds;
|
pic.offset.seconds = state->cur_event.time.seconds;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue