summaryrefslogtreecommitdiffstats
path: root/uemis-downloader.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-12 00:45:52 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-12 00:45:52 -0700
commitf692c39ac793ed999d47d29fd2306910403ad06a (patch)
tree2febf4dc419577dac0ad01c3872752eab2f92034 /uemis-downloader.c
parent5702a520784f83ad9cb84d1f2115ac174de1fa26 (diff)
downloadsubsurface-f692c39ac793ed999d47d29fd2306910403ad06a.tar.gz
Uemis downloader: fix corner case
When we first get an invalid dive info and then, once we decremented the offset, get a valid one but for the wrong dive and then try to calculate the correct offset, we need to keep the existing offset in mind. What a horrid design. Thanks, UEMIS. 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 c1980de4c..16bba7b27 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -919,7 +919,7 @@ const char *do_uemis_import(const char *mountpath, short force_download)
if (divenr == -1) {
offset--;
} else {
- offset = i - divenr;
+ offset += i - divenr;
}
#if UEMIS_DEBUG & 2
fprintf(debugfile, " -> trying again with offset %d\n", offset);