mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 22:12:40 +02:00
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 <leah@libreboot.org>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user