fix(mavlink): use >= for depth check to match MAX_DEPTH semantics

This commit is contained in:
Jacob Dahl 2026-03-06 14:41:52 -09:00 committed by Ramon Roche
parent 8d99569643
commit 55b62e5f2b

View File

@ -527,7 +527,7 @@ void MavlinkLogHandler::delete_all_logs(const char *dir, unsigned depth)
// Log structure is log/yyyy-mm-dd/file.ulg (2 levels). Cap recursion to prevent stack overflow.
static constexpr unsigned MAX_DEPTH = 3;
if (depth > MAX_DEPTH) {
if (depth >= MAX_DEPTH) {
PX4_DEBUG("Max depth reached: %s", dir);
return;
}