[BusyBox] bug#1189: make_human_readable_str chokes with big numbers (GB/TB values)
Erik Andersen
andersen at lineo.com
Tue Jul 3 21:23:45 UTC 2001
On Fri Jun 29, 2001 at 04:45:27PM -0400, Adam Slattery wrote:
>
> package: busybox
> version: 0.51
> (latest cvs Jun 29 06:00)
>
>
> busybox df -h (with the patch I just submitted for the blocksize bug):
> /dev/ide/host0/bus0/target0/lun0/part2 inf 883M 983M 47% /usr
>
> fileutils df -h:
> /dev/ide/host0/bus0/target0/lun0/part2 1.9G 883M 983M 47% /usr
>
> This isn't good :).
>
> The problem is that in human_readable.c, a 32 bit variable ends up getting
> shifted left 40 bits when you have a GB size. The fix is to use a
> variable as big as the result size (long double). A small problem arrises:
This is now fixed with the latest updates to human_readable.c, and
Manuel even managed to eliminate the need for floats.
-Erik
--
Erik B. Andersen email: andersen at lineo.com
--This message was written using 73% post-consumer electrons--
More information about the busybox
mailing list