diff --git a/src/Services/EventActionService.cpp b/src/Services/EventActionService.cpp index 5938837c1479cdec832c009a24b1e7e44c49dfeb..7446ed78388557f26b40b08202cdec2902176ed3 100644 --- a/src/Services/EventActionService.cpp +++ b/src/Services/EventActionService.cpp @@ -25,11 +25,12 @@ void EventActionService::addEventActionDefinitions(Message message) { eventActionDefinitionArray[index].eventDefinitionID = message.readEnum16(); // Tests pass with message.dataSize - 3, message.dataSize - 4, but not // message.dataSize - 5 - if (message.dataSize - 4 > ECSS_EVENT_SERVICE_STRING_SIZE) { // Should this be >= ? + if (message.dataSize - 4 > ECSS_EVENT_SERVICE_STRING_SIZE) { // TODO: Fix this ErrorHandler::reportInternalError(ErrorHandler::InternalErrorType::MessageTooLarge); } else { char data[ECSS_EVENT_SERVICE_STRING_SIZE]; - message.readString(data, message.dataSize); + std::cout << message.dataSize; + message.readString(data, message.dataSize - 4); eventActionDefinitionArray[index].request = String<ECSS_EVENT_SERVICE_STRING_SIZE>( data); }