diff --git a/uemis-downloader.c b/uemis-downloader.c index ec146afee..90f3d2317 100644 --- a/uemis-downloader.c +++ b/uemis-downloader.c @@ -730,8 +730,12 @@ static char *get_divenr(char *deviceidstr) deviceid = atoi(deviceidstr); for (i = 0; i < dive_table.nr; i++) { struct divecomputer *dc = &dive_table.dives[i]->dc; - if (dc->deviceid == deviceid && dc->diveid > maxdiveid) - maxdiveid = dc->diveid; + while (dc) { + if (!strcmp(dc->model, "Uemis Zurich") && + dc->deviceid == deviceid && dc->diveid > maxdiveid) + maxdiveid = dc->diveid; + dc = dc->next; + } } snprintf(divenr, 10, "%d", maxdiveid); return strdup(divenr);