aboutsummaryrefslogtreecommitdiffstats
path: root/core/device.c
diff options
context:
space:
mode:
authorGravatar Stefan Fuchs <sfuchs@gmx.de>2017-11-05 15:58:24 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-11-13 20:50:10 -0800
commitadbc71f9daf6778cf7402a18f9d954226bfceda4 (patch)
tree775ed19cf46165a707a5b69393fdabf37d3a939f /core/device.c
parent1f8506ce645000bd158fcd3b2c9c799505c78bb2 (diff)
downloadsubsurface-adbc71f9daf6778cf7402a18f9d954226bfceda4.tar.gz
Init every struct sample with default values
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Diffstat (limited to 'core/device.c')
-rw-r--r--core/device.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/device.c b/core/device.c
index 25c5136a9..d5e723765 100644
--- a/core/device.c
+++ b/core/device.c
@@ -114,6 +114,7 @@ struct divecomputer *fake_dc(struct divecomputer *dc, bool alloc)
static struct sample fake_samples[6];
static struct divecomputer fakedc;
struct sample *fake = fake_samples;
+ int i;
fakedc = (*dc);
if (alloc)
@@ -129,6 +130,10 @@ struct divecomputer *fake_dc(struct divecomputer *dc, bool alloc)
memset(fake, 0, sizeof(fake_samples));
fake[5].time.seconds = max_t;
+ for (i = 0; i < 6; i++) {
+ fake_samples[i].bearing.degrees = -1;
+ fake_samples[i].ndl.seconds = -1;
+ }
if (!max_t || !max_d)
return &fakedc;