Skip to content

Commit

Permalink
(nasa#2465) use u8 instead of char
Browse files Browse the repository at this point in the history
  • Loading branch information
japrozs committed Jan 7, 2024
1 parent 7d13cbd commit 788ac37
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 788ac37

Please sign in to comment.