aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/dive.c2
-rw-r--r--core/divesite.c7
2 files changed, 4 insertions, 5 deletions
diff --git a/core/dive.c b/core/dive.c
index 8cec50407..84d476958 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -670,7 +670,7 @@ void copy_cylinders(struct dive *s, struct dive *d, bool used_only)
memset(&d->cylinder[i], 0, sizeof(cylinder_t));
}
for (i = j = 0; i < MAX_CYLINDERS; i++) {
- if (!used_only || is_cylinder_used(s, i)) {
+ if (!used_only || is_cylinder_used(s, i) || s->cylinder[i].cylinder_use == NOT_USED) {
d->cylinder[j].type = s->cylinder[i].type;
d->cylinder[j].type.description = copy_string(s->cylinder[i].type.description);
d->cylinder[j].gasmix = s->cylinder[i].gasmix;
diff --git a/core/divesite.c b/core/divesite.c
index fd25bb965..3d5547905 100644
--- a/core/divesite.c
+++ b/core/divesite.c
@@ -314,10 +314,9 @@ void clear_dive_site(struct dive_site *ds)
free(ds->name);
free(ds->notes);
free(ds->description);
- free(ds->name);
- ds->name = 0;
- ds->notes = 0;
- ds->description = 0;
+ ds->name = NULL;
+ ds->notes = NULL;
+ ds->description = NULL;
ds->latitude.udeg = 0;
ds->longitude.udeg = 0;
ds->uuid = 0;