projects
/
platform
/
upstream
/
toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2c7028a
)
Tweak of Elliott Hughes's fix for an off by one error in human_readable
author
Rob Landley
<rob@landley.net>
Mon, 23 Mar 2015 16:49:58 +0000
(11:49 -0500)
committer
Rob Landley
<rob@landley.net>
Mon, 23 Mar 2015 16:49:58 +0000
(11:49 -0500)
(137 returned "137 KB".)
lib/lib.c
patch
|
blob
|
history
diff --git
a/lib/lib.c
b/lib/lib.c
index
f70d379
..
0f2b012
100644
(file)
--- a/
lib/lib.c
+++ b/
lib/lib.c
@@
-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) {