From: Jim Meyering Date: Tue, 5 Nov 2002 17:22:55 +0000 (+0000) Subject: (cksum): Use primitives from inttostr.h, not X-Git-Tag: v4.5.4~328 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a591db74651d5406dc7452c5bf9c862a8c234231;p=thirdparty%2Fcoreutils.git (cksum): Use primitives from inttostr.h, not human.h, to print large numbers simply. --- diff --git a/src/cksum.c b/src/cksum.c index c7de79edfc..9148e94461 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];