Skip to content
Snippets Groups Projects
Unverified Commit 5458b127 authored by Dimitrios Stoupis's avatar Dimitrios Stoupis
Browse files

Fixed a comparison operator

- Added a less than or equal to comaprison operator in the check of the
string size vs its capacity. If the operator is <, then errors are
thrown in the case where the string is fully loaded.
parent 4ef1ec5b
No related branches found
No related tags found
No related merge requests found
......@@ -437,7 +437,7 @@ template<const size_t SIZE>
inline void Message::appendString(const String<SIZE> & string) {
assertI(dataSize + string.size() < ECSS_MAX_MESSAGE_SIZE, ErrorHandler::MessageTooLarge);
// TODO: Do we need to keep this check? How does etl::string handle it?
assertI(string.size() < string.capacity(), ErrorHandler::StringTooLarge);
assertI(string.size() <= string.capacity(), ErrorHandler::StringTooLarge);
memcpy(data + dataSize, string.data(), string.size());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment