Function df_readable() won't print negative value correctly. Don't pass -n
to human_readable(), add a prefix '-' in the char buffer is enough.


Signed-off-by: Shan Wei <[EMAIL PROTECTED]>
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>

---
 src/df.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/df.c b/src/df.c
index f0fdcd7..e9c82f5 100644
--- a/src/df.c
+++ b/src/df.c
@@ -241,7 +241,7 @@ df_readable (bool negative, uintmax_t n, char *buf,
     return "-";
   else
     {
-      char *p = human_readable (negative ? -n : n, buf + negative,
+      char *p = human_readable (negative, buf + negative,
                                human_output_opts, input_units, output_units);
       if (negative)
        *--p = '-';
-- 
1.5.3.rc7




_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to