Mercurial > hvf > hvf-old
changeset 480:aba2ded209f4
installer: fix EDF allocmap bug
We were checking the bits of each byte one way, but returning them the
other.
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Fri, 15 Apr 2011 21:07:04 -0400 |
parents | 6ebb4657b898 |
children | 9fac53826047 |
files | installer/edf.c |
diffstat | 1 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/installer/edf.c Fri Apr 15 21:06:56 2011 -0400 +++ b/installer/edf.c Fri Apr 15 21:07:04 2011 -0400 @@ -289,14 +289,14 @@ if (buf[i] == 0xff) continue; - if ((buf[i] & 0x80) == 0) { bit = 7; goto found; } - if ((buf[i] & 0x40) == 0) { bit = 6; goto found; } - if ((buf[i] & 0x20) == 0) { bit = 5; goto found; } - if ((buf[i] & 0x10) == 0) { bit = 4; goto found; } - if ((buf[i] & 0x08) == 0) { bit = 3; goto found; } - if ((buf[i] & 0x04) == 0) { bit = 2; goto found; } - if ((buf[i] & 0x02) == 0) { bit = 1; goto found; } - if ((buf[i] & 0x01) == 0) { bit = 0; goto found; } + if ((buf[i] & 0x80) == 0) { bit = 0; goto found; } + if ((buf[i] & 0x40) == 0) { bit = 1; goto found; } + if ((buf[i] & 0x20) == 0) { bit = 2; goto found; } + if ((buf[i] & 0x10) == 0) { bit = 3; goto found; } + if ((buf[i] & 0x08) == 0) { bit = 4; goto found; } + if ((buf[i] & 0x04) == 0) { bit = 5; goto found; } + if ((buf[i] & 0x02) == 0) { bit = 6; goto found; } + if ((buf[i] & 0x01) == 0) { bit = 7; goto found; } continue; /* this is not necessary since we check for 0xff right away, but GCC really @@ -304,7 +304,7 @@ uninitialized use of 'bit' */ found: - buf[i] |= (1 << bit); + buf[i] |= (0x80 >> bit); blk_set_dirty(allocmap->FNAME, allocmap->FTYPE, 0, blk);