diff options
author | Rob Landley <rob@landley.net> | 2015-03-23 11:49:58 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2015-03-23 11:49:58 -0500 |
commit | 4b77d5419a0f2f4f8fdb9ad39dceddf75305b2a1 (patch) | |
tree | 8532a6de34a92200c0833ca6b0a66b4321f1e41d /lib | |
parent | 2c7028ad7572d1860c20e3dca2e48a7f6ca2cb00 (diff) | |
download | toybox-4b77d5419a0f2f4f8fdb9ad39dceddf75305b2a1.tar.gz toybox-4b77d5419a0f2f4f8fdb9ad39dceddf75305b2a1.tar.bz2 toybox-4b77d5419a0f2f4f8fdb9ad39dceddf75305b2a1.zip |
Tweak of Elliott Hughes's fix for an off by one error in human_readable
(137 returned "137 KB".)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -868,8 +868,8 @@ int human_readable(char *buf, unsigned long long num) { 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) { |