diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-08-22 23:08:37 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-08-22 23:08:37 +0000 |
commit | 6d8efecd04bcae9c1c2e7106212fd7c444f92fad (patch) | |
tree | 9fd8d2a4b154f2e6b4707480f2a1c4709c5103ff /libbb | |
parent | a1299e52b462e50b4ca38b5679a3fd7d92b2f72c (diff) | |
download | busybox-w32-6d8efecd04bcae9c1c2e7106212fd7c444f92fad.tar.gz busybox-w32-6d8efecd04bcae9c1c2e7106212fd7c444f92fad.tar.bz2 busybox-w32-6d8efecd04bcae9c1c2e7106212fd7c444f92fad.zip |
"staywithu" writes:
In BusyBox v1.00-pre2,
commands like ls, df with -h option report a wrong file size for files larger than 4GBtye!!
For example,
when I execute 'ls -l', it reports
-rw-r--r-- 1 root root 5368709120 Aug 17 2003 large_stream.tp
when I execute 'ls -lh', I expect that
-rw-r--r-- 1 root root 5.0G Aug 17 2003 large_stream.tp
but it reports
-rw-r--r-- 1 root root 1.0G Aug 17 2003 large_stream.tp
I fixed this bug that...
Line 31 in libbb/human_readable.c and line 275 include/libbb.h
const char *make_human_readable_str(unsigned long size
=> const char *make_human_readable_str(unsigned long long size
It's OK!
git-svn-id: svn://busybox.net/trunk/busybox@7253 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/human_readable.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libbb/human_readable.c b/libbb/human_readable.c index 7bdad36a9..656889150 100644 --- a/libbb/human_readable.c +++ b/libbb/human_readable.c | |||
@@ -28,9 +28,8 @@ | |||
28 | #include <stdio.h> | 28 | #include <stdio.h> |
29 | #include "libbb.h" | 29 | #include "libbb.h" |
30 | 30 | ||
31 | const char *make_human_readable_str(unsigned long size, | 31 | const char *make_human_readable_str(unsigned long long size, |
32 | unsigned long block_size, | 32 | unsigned long block_size, unsigned long display_unit) |
33 | unsigned long display_unit) | ||
34 | { | 33 | { |
35 | /* The code will adjust for additional (appended) units. */ | 34 | /* The code will adjust for additional (appended) units. */ |
36 | static const char zero_and_units[] = { '0', 0, 'k', 'M', 'G', 'T' }; | 35 | static const char zero_and_units[] = { '0', 0, 'k', 'M', 'G', 'T' }; |
@@ -48,7 +47,7 @@ const char *make_human_readable_str(unsigned long size, | |||
48 | f = fmt; | 47 | f = fmt; |
49 | frac = 0; | 48 | frac = 0; |
50 | 49 | ||
51 | val = ((unsigned long long) size) * block_size; | 50 | val = size * block_size; |
52 | if (val == 0) { | 51 | if (val == 0) { |
53 | return u; | 52 | return u; |
54 | } | 53 | } |