From 1d48ce100b8e34fcf6201b8fa5c15c16315e3c65 Mon Sep 17 00:00:00 2001 From: Free Ekanayaka Date: Mon, 3 Aug 2020 10:40:28 +0200 Subject: [PATCH] Honor endianness when decoding test FSM commands --- test/lib/fsm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/lib/fsm.c b/test/lib/fsm.c index a2d0ae20a..36a96592b 100644 --- a/test/lib/fsm.c +++ b/test/lib/fsm.c @@ -18,6 +18,7 @@ static int fsmApply(struct raft_fsm *fsm, void **result) { struct fsm *f = fsm->data; + const void *cursor = buf->base; unsigned command; int value; @@ -25,8 +26,8 @@ static int fsmApply(struct raft_fsm *fsm, 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: