mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 14:43:34 +08:00
More string refactoring
This commit is contained in:
@@ -20,6 +20,8 @@ namespace uavcan
|
||||
{
|
||||
/**
|
||||
* The file server backend should implement this interface.
|
||||
* Note that error codes returned by these methods are defined in uavcan.protocol.file.Error; these are
|
||||
* not the same as libuavcan-internal error codes defined in uavcan.error.hpp.
|
||||
*/
|
||||
class UAVCAN_EXPORT IFileServerBackend
|
||||
{
|
||||
@@ -136,6 +138,11 @@ class BasicFileServer
|
||||
|
||||
resp.error.value = backend_.read(req.path.path, req.offset, resp.data.begin(), inout_size);
|
||||
|
||||
if (resp.error.value != protocol::file::Error::OK)
|
||||
{
|
||||
inout_size = 0;
|
||||
}
|
||||
|
||||
if (inout_size > resp.data.capacity())
|
||||
{
|
||||
UAVCAN_ASSERT(0);
|
||||
|
||||
Reference in New Issue
Block a user