diff --git a/src/fsfw/tmtcpacket/ccsds/SpacePacketCreator.cpp b/src/fsfw/tmtcpacket/ccsds/SpacePacketCreator.cpp index 745d5834..550f0e1a 100644 --- a/src/fsfw/tmtcpacket/ccsds/SpacePacketCreator.cpp +++ b/src/fsfw/tmtcpacket/ccsds/SpacePacketCreator.cpp @@ -43,9 +43,10 @@ ReturnValue_t SpacePacketCreator::serialize(uint8_t **buffer, size_t *size, size void SpacePacketCreator::setCcsdsLenFromTotalDataFieldLen(size_t actualLength) { if (actualLength == 0) { - return; + setDataLenField(actualLength); + } else { + setDataLenField(actualLength - 1); } - setDataLenField(actualLength - 1); } size_t SpacePacketCreator::getSerializedSize() const { return ccsds::HEADER_LEN; }