summaryrefslogtreecommitdiffstats
path: root/divecomputer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'divecomputer.cpp')
-rw-r--r--divecomputer.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/divecomputer.cpp b/divecomputer.cpp
index 6044f1aa6..c714137a2 100644
--- a/divecomputer.cpp
+++ b/divecomputer.cpp
@@ -162,9 +162,9 @@ extern "C" void set_dc_nickname(struct dive *dive)
if (!dive)
return;
- struct divecomputer *dc = &dive->dc;
+ struct divecomputer *dc;
- while (dc) {
+ for_each_dc(dive, dc) {
if (dc->model && *dc->model && dc->deviceid &&
!dcList.getExact(dc->model, dc->deviceid)) {
// we don't have this one, yet
@@ -181,6 +181,5 @@ extern "C" void set_dc_nickname(struct dive *dive)
dcList.addDC(dc->model, dc->deviceid);
}
}
- dc = dc->next;
}
}