diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-12-06 13:38:38 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-12-06 13:38:38 -0800 |
commit | eb0ccace773555c328bee98c78c43ed104d54481 (patch) | |
tree | 7a1e7b1640b6ecc7cb961fe886a41959e98ca634 /subsurface-core | |
parent | 491ef7edc80ca2af4684cd011f93d453ff15a2af (diff) | |
download | subsurface-eb0ccace773555c328bee98c78c43ed104d54481.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 'subsurface-core')
-rw-r--r-- | subsurface-core/uemis-downloader.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/subsurface-core/uemis-downloader.c b/subsurface-core/uemis-downloader.c index 8e7f9f60a..6f5c5f177 100644 --- a/subsurface-core/uemis-downloader.c +++ b/subsurface-core/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 { |