From efe2635c1216867888d2e01f40f0a2d1c3aefd3f Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 3 Mar 2026 03:50:22 +0000 Subject: nvmutil: fix the swap function irrelevant for most users, who are on little endian anyway, but i broke the swap function on big endian systems. this fixes it. the new function uses an intermediate variable instead of xor swapping, but i accidentally left some relics of of the old xor swaps in place. this fixes that. Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 8314ba44..dd06a0ca 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -452,8 +452,8 @@ swap(int partnum) for (size_t w = NVM_SIZE * ((uint8_t *) &e)[0], x = 1; w < NVM_SIZE; w += 2, x += 2) { uint8_t chg = n[w]; - n[w] ^= n[x]; - n[x] ^= chg; + n[w] = n[x]; + n[x] = chg; } } -- cgit v1.2.1