Summary Files Commits Branches @commit @diff @stats
path: root / src / message.cpp
diff options
context:
space:
mode:
Commita1b252f1552492ac2b928276ef9d1ac95ea567af (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-07-03 15:22:05 +0300
Committer
 Syndamia <kamen@syndamia.com>
2025-07-03 15:22:05 +0300
Filesaebba26ab308174730515907aad5ed273f885c74 /src/message.cpp
iso-tp-parser-carista-a1b252f1552492ac2b928276ef9d1ac95ea567af.tar
iso-tp-parser-carista-a1b252f1552492ac2b928276ef9d1ac95ea567af.tar.gz
iso-tp-parser-carista-a1b252f1552492ac2b928276ef9d1ac95ea567af.zip
Parent61c4f3192d742be4c9a7a5f5e2bf84e42b9a6306 (diff)
chore: Add documentation comments where needed
1 files changed, 3 insertions, 0 deletions
-rw-r--r--src/message.cpp3
diff --git a/src/message.cpp b/src/message.cpp
index ee1d8fe..834fd87 100644
--- a/src/message.cpp
+++ b/src/message.cpp
@@ -41,7 +41,10 @@ Message& Message::operator=(const Message& other) {
}
void Message::receive_frame(const Frame& f) {
+ // For CFs we set the data size to 7 (the maximum), however, we may be expecting
+ // to receive less data (in the last CF).
size_t expects = std::min(this->size - this->received, f.get_data_size());
+
std::memcpy(this->msg + this->received, f.get_data(), expects);
this->received += expects;
}