From 462b5721721122c94bc7a3c43ae7f37c41ee625d Mon Sep 17 00:00:00 2001 From: Sander Swart Date: Tue, 23 Nov 2021 15:25:12 +0100 Subject: [PATCH] Fixed mavlink_ftp read Instead of always reading the max data length, it now properly respects the requested amount of bytes (as per documentation) --- src/modules/mavlink/mavlink_ftp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/mavlink/mavlink_ftp.cpp b/src/modules/mavlink/mavlink_ftp.cpp index 32eaf9624d..fe4e5e8f40 100644 --- a/src/modules/mavlink/mavlink_ftp.cpp +++ b/src/modules/mavlink/mavlink_ftp.cpp @@ -572,7 +572,7 @@ MavlinkFTP::_workRead(PayloadHeader *payload) return kErrFailErrno; } - int bytes_read = ::read(_session_info.fd, &payload->data[0], kMaxDataLength); + int bytes_read = ::read(_session_info.fd, &payload->data[0], payload->size); if (bytes_read < 0) { // Negative return indicates error other than eof