summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--uemis-downloader.c3
-rw-r--r--uemis.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/uemis-downloader.c b/uemis-downloader.c
index b693421b9..422185393 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -1127,7 +1127,8 @@ static bool get_matching_dive(int idx, char *newmax, int *uemis_mem_status, stru
fprintf(debugfile, "Matching divelog id %d from %s with dive details %d\n", dive->dc.diveid, d_time, dive_to_read);
#endif
int divespot_id = uemis_get_divespot_id_by_diveid(dive->dc.diveid);
- get_uemis_divespot(mountpath, divespot_id, dive);
+ if (divespot_id >= 0)
+ get_uemis_divespot(mountpath, divespot_id, dive);
} else {
/* in this case we found a deleted file, so let's increment */
diff --git a/uemis.c b/uemis.c
index 7221256b9..4135e0cfe 100644
--- a/uemis.c
+++ b/uemis.c
@@ -162,7 +162,7 @@ int uemis_get_divespot_id_by_diveid(uint32_t diveid)
return hp->divespot;
hp = hp->next;
}
- return 0;
+ return -1;
}
void uemis_set_divelocation(int divespot, char *text, double longitude, double latitude)