Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #146 from freeekanayaka/fix-encoding-of-test-fsm
Browse files Browse the repository at this point in the history
Honor endianness when decoding test FSM commands
  • Loading branch information
stgraber committed Aug 3, 2020
2 parents bfd7d57 + 1d48ce1 commit 1e3f2fd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/lib/fsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ static int fsmApply(struct raft_fsm *fsm,
void **result)
{
struct fsm *f = fsm->data;
const void *cursor = buf->base;
unsigned command;
int value;

if (buf->len != 16) {
return -1;
}

command = *(uint64_t *)buf->base;
value = *((int64_t *)buf->base + 1);
command = (unsigned)byteGet64(&cursor);
value = (int)byteGet64(&cursor);

switch (command) {
case SET_X:
Expand Down

0 comments on commit 1e3f2fd

Please sign in to comment.