summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-11-04 10:08:51 +0000
committerJim Meyering <jim@meyering.net>2005-11-04 10:08:51 +0000
commit933576b4401b9e33ac792aa441ee2a128eb04850 (patch)
tree8d98e91078e7c0a7e01b27238c8d091f3569f3ad /src
parentcf18eb7ca4ea6bf07570044656b70348699e6f2b (diff)
downloadcoreutils-933576b4401b9e33ac792aa441ee2a128eb04850.tar.xz
(process_file): Don't overflow for files of size >= 2^31
on systems with stat.st_blocks of a signed 32-bit type. This bug causes trouble on some AIX 5.1 systems. Report and trivial patch from Paul Townsend: <http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00033.html>
Diffstat (limited to 'src')
-rw-r--r--src/du.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/du.c b/src/du.c
index 12c21aa97..361f67639 100644
--- a/src/du.c
+++ b/src/du.c
@@ -537,7 +537,7 @@ process_file (FTS *fts, FTSENT *ent)
duinfo_set (&dui,
(apparent_size
? sb->st_size
- : ST_NBLOCKS (*sb) * ST_NBLOCKSIZE),
+ : (uintmax_t) ST_NBLOCKS (*sb) * ST_NBLOCKSIZE),
(time_type == time_mtime ? get_stat_mtime (sb)
: time_type == time_atime ? get_stat_atime (sb)
: get_stat_ctime (sb)));