From d7033dbf0dc1b9d863ed99f2811a7379bd52502d Mon Sep 17 00:00:00 2001 From: Michel Pastor Date: Thu, 3 Oct 2019 16:56:34 +0200 Subject: [PATCH] AP_Logger: fix AP_Logger_Block::get_num_logs() --- libraries/AP_Logger/AP_Logger_Block.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_Logger/AP_Logger_Block.cpp b/libraries/AP_Logger/AP_Logger_Block.cpp index fc0c81cf3d..e17ca13c53 100644 --- a/libraries/AP_Logger/AP_Logger_Block.cpp +++ b/libraries/AP_Logger/AP_Logger_Block.cpp @@ -344,7 +344,7 @@ uint16_t AP_Logger_Block::get_num_logs(void) last = GetFileNumber(); StartRead(lastpage + 2); if (GetFileNumber() == 0xFFFF) { - StartRead(((lastpage >> 8) + 1) << 8); // next sector + StartRead(((((lastpage-1)>>8)+1)<<8)+1); // next sector } first = GetFileNumber(); if (first > last) {