More string refactoring

This commit is contained in:
David Sidrane
2015-05-21 07:25:53 -10:00
parent fa11a76143
commit 64b14db1f5
7 changed files with 222 additions and 167 deletions
@@ -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);