diff options
author | Anton Lundin <glance@acc.umu.se> | 2014-12-12 08:59:11 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-12-12 07:01:16 -0800 |
commit | 46bd71a18427b5cc650b26b4d77d9a1260b79941 (patch) | |
tree | 17fa36eb79ce9a36d5a8a121f463546394a4ec10 /dive.c | |
parent | e7698beea779be6a372f3194b63d6e94f878c7ae (diff) | |
download | subsurface-46bd71a18427b5cc650b26b4d77d9a1260b79941.tar.gz |
Initialize alloc_samples in copy_samples
We rely on alloc_samples in prepare_sample. If alloc_samples weren't
initialized prepare_sample would wreak havoc on the samples list.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r-- | dive.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -601,6 +601,7 @@ void copy_samples(struct divecomputer *s, struct divecomputer *d) return; int nr = s->samples; d->samples = nr; + d->alloc_samples = nr; d->sample = malloc(nr * sizeof(struct sample)); if (d->sample) memcpy(d->sample, s->sample, nr * sizeof(struct sample)); |