aboutsummaryrefslogtreecommitdiffstats
path: root/uemis-downloader.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-20 06:37:19 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-20 06:37:19 +0900
commit09e7c61feeeabac3dd983c11aca49b23155fff80 (patch)
treef82b271b89dd0f2f85cc78a1c0724df29204f439 /uemis-downloader.c
parentb303f217a9d66ef031c58534b3796ddefbe362c5 (diff)
downloadsubsurface-09e7c61feeeabac3dd983c11aca49b23155fff80.tar.gz
Consistently use for_each_dive (and use it correctly)
The way the macro is written there is no need to test the dive against NULL before dereferencing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'uemis-downloader.c')
-rw-r--r--uemis-downloader.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/uemis-downloader.c b/uemis-downloader.c
index d0c3de13e..797704c66 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -793,8 +793,9 @@ static char *uemis_get_divenr(char *deviceidstr)
char divenr[10];
deviceid = atoi(deviceidstr);
- for (i = 0; i < dive_table.nr; i++) {
- struct divecomputer *dc = &dive_table.dives[i]->dc;
+ struct dive *d;
+ for_each_dive (i, d) {
+ struct divecomputer *dc = &d->dc;
while (dc) {
if (dc->model && !strcmp(dc->model, "Uemis Zurich") &&
(dc->deviceid == 0 || dc->deviceid == 0x7fffffff || dc->deviceid == deviceid) &&