summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-26 11:44:24 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-26 11:44:24 -0800
commit6d69325185374dfcff13108ad182e67a60542ef1 (patch)
treefd860f776b5421ba60a89922d91f6887d91f872c /profile.c
parent5cea16ec509bdca4d9410aea193277fa42fba1a4 (diff)
downloadsubsurface-6d69325185374dfcff13108ad182e67a60542ef1.tar.gz
For divecomputers without samples don't lose other data for profile
We create a fake divecomputer in order to draw a reasonable profile, but when setting that up we used an empty divecomputer instead of starting with the one that we have. This lost data (e.g., the model name of the dc). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/profile.c b/profile.c
index d3501d0da..fe07c78a2 100644
--- a/profile.c
+++ b/profile.c
@@ -2012,10 +2012,10 @@ void plot(struct graphics_context *gc, struct dive *dive, scale_mode_t scale)
if (!dc->samples) {
static struct sample fake[4];
- static struct divecomputer fakedc = {
- .sample = fake,
- .samples = 4
- };
+ static struct divecomputer fakedc;
+ fakedc = dive->dc;
+ fakedc.sample = fake;
+ fakedc.samples = 4;
/* The dive has no samples, so create a few fake ones. This assumes an
ascent/descent rate of 9 m/min, which is just below the limit for FAST. */