diff options
author | Jim Meyering <jim@meyering.net> | 2002-11-05 17:22:55 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2002-11-05 17:22:55 +0000 |
commit | a591db74651d5406dc7452c5bf9c862a8c234231 (patch) | |
tree | 57e0e8ba61971c583b88c77c2ae3fbaed7eca283 /src/cksum.c | |
parent | adaa25e292fa50fb4586a59500aa964ab4ff3234 (diff) | |
download | coreutils-a591db74651d5406dc7452c5bf9c862a8c234231.tar.xz |
(cksum): Use primitives from inttostr.h, not
human.h, to print large numbers simply.
Diffstat (limited to 'src/cksum.c')
-rw-r--r-- | src/cksum.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cksum.c b/src/cksum.c index c7de79edf..9148e9446 100644 --- a/src/cksum.c +++ b/src/cksum.c @@ -120,7 +120,7 @@ main (void) # include "closeout.h" # include "long-options.h" # include "error.h" -# include "human.h" +# include "inttostr.h" /* Number of bytes to read at once. */ # define BUFLEN (1 << 16) @@ -205,8 +205,8 @@ cksum (const char *file, int print_name) uintmax_t length = 0; size_t bytes_read; register FILE *fp; - char hbuf[LONGEST_HUMAN_READABLE + 1]; - char *hp; + char length_buf[INT_BUFSIZE_BOUND (uintmax_t)]; + char const *hp; if (STREQ (file, "-")) { @@ -251,7 +251,7 @@ cksum (const char *file, int print_name) return -1; } - hp = human_readable (length, hbuf, 1, 1); + hp = umaxtostr (length, length_buf); for (; length; length >>= 8) crc = (crc << 8) ^ crctab[((crc >> 24) ^ length) & 0xFF]; |