# HG changeset patch # User Rob Landley # Date 1427129398 18000 # Node ID 12761285eaee61d5bc21d45606d7c795e11b6927 # Parent 6f107e78cd9d0d2da0e8022b9f259e270d7377ff Tweak of Elliott Hughes's fix for an off by one error in human_readable (137 returned "137 KB".) diff -r 6f107e78cd9d -r 12761285eaee lib/lib.c --- a/lib/lib.c Mon Mar 23 11:44:56 2015 -0500 +++ b/lib/lib.c Mon Mar 23 11:49:58 2015 -0500 @@ -868,8 +868,8 @@ { int end, len; - len = sprintf(buf, "%lld", num); - end = ((len-1)%3)+1; + len = sprintf(buf, "%lld", num)-1; + end = (len%3)+1; len /= 3; if (len && end == 1) {