mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Correct the detection of existing dives in the Uemis downloader
This didn't take multiple divecomputers into account and didn't compare the model as well as the deviceid to match a divecomputer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
020154215d
commit
0233239198
1 changed files with 6 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue