changeset 1749:12761285eaee

Tweak of Elliott Hughes's fix for an off by one error in human_readable (137 returned "137 KB".)
author Rob Landley <rob@landley.net>
date Mon, 23 Mar 2015 11:49:58 -0500
parents 6f107e78cd9d
children 8f59893165fa
files lib/lib.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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) {