diff options
author | Stefan Fuchs <sfuchs@gmx.de> | 2017-11-05 15:58:24 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-11-13 20:50:10 -0800 |
commit | adbc71f9daf6778cf7402a18f9d954226bfceda4 (patch) | |
tree | 775ed19cf46165a707a5b69393fdabf37d3a939f /core/dive.c | |
parent | 1f8506ce645000bd158fcd3b2c9c799505c78bb2 (diff) | |
download | subsurface-adbc71f9daf6778cf7402a18f9d954226bfceda4.tar.gz |
Init every struct sample with default values
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Diffstat (limited to 'core/dive.c')
-rw-r--r-- | core/dive.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/dive.c b/core/dive.c index 9e3d42a44..7cad36154 100644 --- a/core/dive.c +++ b/core/dive.c @@ -1727,7 +1727,7 @@ static void merge_one_sample(struct sample *sample, int time, struct divecompute { int last = dc->samples - 1; if (last >= 0) { - static struct sample surface; + static struct sample surface = { .bearing.degrees = -1, .ndl.seconds = -1 }; struct sample *prev = dc->sample + last; int last_time = prev->time.seconds; int last_depth = prev->depth.mm; @@ -1772,7 +1772,7 @@ static void merge_samples(struct divecomputer *res, struct divecomputer *a, stru for (;;) { int at, bt; - struct sample sample; + struct sample sample = { .bearing.degrees = -1, .ndl.seconds = -1 }; if (!res) return; |