From 29d43531d26c0a6c178f39bee98e618f1ed23949 Mon Sep 17 00:00:00 2001 From: glerch Date: Mon, 14 Sep 2015 10:31:29 +0200 Subject: [PATCH] Uemis bugfix Fixed a bug in do_uemis_download when cleaning up delted dives. My test for valid dives was wrong. now counting the nr of dives in the download table. Signed-off-by: glerch Signed-off-by: Dirk Hohndel --- uemis-downloader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uemis-downloader.c b/uemis-downloader.c index 9db2f33be..7e7c4fc5b 100644 --- a/uemis-downloader.c +++ b/uemis-downloader.c @@ -10,7 +10,7 @@ * Zurich) but did not actually use any of his copyrighted code, therefore the license under which * he released his code does not apply to this new implementation in C * - * Modified by Guido Lerch guido.lerch@gmx.ch in August 2015 + * Modified by Guido Lerch guido.lerch@gmail.com in August 2015 */ #include #include @@ -1301,7 +1301,7 @@ const char *do_uemis_import(device_data_t *data) /* Regardless on where we are with the memory situation, it's time now * to see if we have to clean some dead bodies from our download table */ next_table_index = 0; - while (data->download_table->dives[next_table_index]) { + while (next_table_index < data->download_table->nr) { if (!data->download_table->dives[next_table_index]->downloaded) uemis_delete_dive(data, data->download_table->dives[next_table_index]->dc.diveid); else