summaryrefslogtreecommitdiffstats
path: root/uemis-downloader.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-06 13:38:38 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-06 13:41:07 -0800
commite1768b4771be6b2830f1c291a17cae859f80ec95 (patch)
tree00579597c041e2f7bc773101bc8105d1997533f8 /uemis-downloader.c
parent76c97f2e5783c82f24cbf03c7279a67f133435dc (diff)
downloadsubsurface-e1768b4771be6b2830f1c291a17cae859f80ec95.tar.gz
Uemis downloader: handle yet another corner case
If we looking for dive details and are trying to guess the offset between object_id and logfilenr, we need to treat logfilenr 0 as special - it means we read past the end of the list of stored dives and need to walk backwards. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'uemis-downloader.c')
-rw-r--r--uemis-downloader.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/uemis-downloader.c b/uemis-downloader.c
index a9c462db1..9358bb8ee 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -1185,7 +1185,7 @@ static bool get_matching_dive(int idx, char *newmax, int *uemis_mem_status, stru
char *logfilenr = strstr(mbuf, "logfilenr");
if (logfilenr) {
sscanf(logfilenr, "logfilenr{int{%u", &nr_found);
- if (nr_found >= dive->dc.diveid) {
+ if (nr_found >= dive->dc.diveid || nr_found == 0) {
found_above = true;
dive_to_read = dive_to_read - 2;
} else {