[Bug 191270] df -h output missing units when size is 1TB

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Jun 24 14:47:00 UTC 2014


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191270

--- Comment #5 from bycn82 at gmail.com ---
Created attachment 144102
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=144102&action=edit
i am describing this patch

        /*
         * Divide the number until it fits the given column.
         * If there will be an overflow by the rounding below,
         * divide once more.
         */
        for (i = 0;
            (quotient >= max || (quotient == max - 1 &&
            remainder >= divisordeccut)) && i < maxscale; i++) {
            remainder = quotient % divisor;
            quotient /= divisor;
        }

Here to calculate the quotient, (max=1000, devisor=1024,) so when the quotient
happently become 999, then "quotient >= max" is false! so it will stop and
print it,
when quotient is 999, after floor the remainder. it will print 1000

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list