[build] Fix signed/unsigned division in util/zbin.c
authorStefan Hajnoczi <stefanha@gmail.com>
Fri, 24 Apr 2009 09:21:07 +0000 (10:21 +0100)
committerMichael Brown <mcb30@etherboot.org>
Sun, 26 Apr 2009 04:48:15 +0000 (05:48 +0100)
commit9b964dec363b12f5f18057d740d96e887cf58186
treedfb7fc6afec711a9cdd58089929dc1f1f61ff07e
parent4b8e021161bbe43f81bb664cceb95d1758a51936
[build] Fix signed/unsigned division in util/zbin.c

Commit b149a99 ([build] Round up SUBx deltas) introduced a
signed/unsigned issue that affects gPXE images built on 32-bit hosts.
The zbin fixup utility performed an unsigned division, which led to
.usb images with an incorrect number of sectors to load.

The issue snuck by on 64-bit hosts since uint32_t is promoted to long.
On 32-bit hosts it is promoted to unsigned long.

Modified-by: Michael Brown <mcb30@etherboot.org>
Signed-off-by: Michael Brown <mcb30@etherboot.org>
src/util/zbin.c