Skip to content

Commit 7acf53d

Browse files
committed
Don't skip the last entry in the logbook buffer
Due to an off by one error, the last entry in the logbook buffer wasn't processed at all. In theory that means the oldest dive is skipped and can't be downloaded. However the logbook buffer usually contains some empty entries at the front. Those are already detected by inspecting the dive number for a zero value and thus the download is already aborted before reaching that last entry. Therefore this bug didn't cause any problems yet in practice.
1 parent ea0cce4 commit 7acf53d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cressi_goa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ cressi_goa_device_foreach (dc_device_t *abstract, dc_dive_callback_t callback, v
431431
// Count the number of dives.
432432
unsigned int count = 0;
433433
unsigned int offset = logbook_size;
434-
while (offset > SZ_HEADER) {
434+
while (offset >= SZ_HEADER) {
435435
// Move to the start of the logbook entry.
436436
offset -= SZ_HEADER;
437437

0 commit comments

Comments
 (0)