bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/2] df: print negative value correctly


From: Li Zefan
Subject: [PATCH 1/2] df: print negative value correctly
Date: Thu, 29 Nov 2007 13:45:09 +0800
User-agent: Thunderbird 2.0.0.0 (X11/20070419)

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 <address@hidden>
Signed-off-by: Li Zefan <address@hidden>

---
 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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]