diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index f8eb384..729f283 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -441,7 +441,7 @@ swap(int partnum) /* swaps bytes in words, not pointers. */ size_t w, x; uint8_t *n = (uint8_t *) gbe[partnum]; - for (w = nf * ((uint8_t *) &e)[0], x = 1; w < NVM_SIZE; + for (w = NVM_SIZE * ((uint8_t *) &e)[0], x = 1; w < NVM_SIZE; w += 2, x += 2) { n[w] ^= n[x]; n[x] ^= n[w];