Uemis downloader: get the right values set before bailing

This caused us to not read the auxiliary information for up to the last
ten dives that were downloaded from the SDA.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-04-21 19:31:05 -07:00
parent 164170cfdf
commit 7101386cb6

View file

@ -910,8 +910,14 @@ const char *do_uemis_import(device_data_t *data)
free(t); free(t);
once = false; once = false;
} }
/* clean up mbuf */
endptr = strstr(mbuf, "{{{");
if (endptr)
*(endptr + 2) = '\0';
/* last object_id we parsed */
sscanf(newmax, "%d", &end);
#if UEMIS_DEBUG & 4 #if UEMIS_DEBUG & 4
fprintf(debugfile, "d_u_i after download and parse start %d end %d newmax %s\n", start, end, newmax); fprintf(debugfile, "d_u_i after download and parse start %d end %d newmax %s progress %4.2f\n", start, end, newmax, progress_bar_fraction);
#endif #endif
/* if the user clicked cancel, exit gracefully */ /* if the user clicked cancel, exit gracefully */
if (import_thread_cancelled) if (import_thread_cancelled)
@ -924,12 +930,6 @@ const char *do_uemis_import(device_data_t *data)
result = translate("gettextFromC", ERR_FS_ALMOST_FULL); result = translate("gettextFromC", ERR_FS_ALMOST_FULL);
break; break;
} }
/* clean up mbuf */
endptr = strstr(mbuf, "{{{");
if (endptr)
*(endptr + 2) = '\0';
/* last object_id we parsed */
sscanf(newmax, "%d", &end);
} }
if (end == -2 && sscanf(newmax, "%d", &end) != 1) if (end == -2 && sscanf(newmax, "%d", &end) != 1)
end = start; end = start;