Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#2465) use u8 instead of char #2471

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Svc/FramingProtocol/FprimeProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ bool FprimeDeframing::validate(Types::CircularBuffer& ring, U32 size) {
// Initialize the checksum and loop through all bytes calculating it
hash.init();
for (U32 i = 0; i < size; i++) {
char byte;
U8 byte;
const Fw::SerializeStatus status = ring.peek(byte, i);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
hash.update(&byte, 1);
}
hash.final(hashBuffer);
// Now loop through the hash digest bytes and check for equality
for (U32 i = 0; i < HASH_DIGEST_LENGTH; i++) {
char calc = static_cast<char>(hashBuffer.getBuffAddr()[i]);
char sent = 0;
U8 calc = static_cast<char>(hashBuffer.getBuffAddr()[i]);
U8 sent = 0;
const Fw::SerializeStatus status = ring.peek(sent, size + i);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
if (calc != sent) {
Expand Down
Loading