From f692c39ac793ed999d47d29fd2306910403ad06a Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 12 May 2014 00:45:52 -0700 Subject: [PATCH] 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 --- uemis-downloader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);