From a591db74651d5406dc7452c5bf9c862a8c234231 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 5 Nov 2002 17:22:55 +0000 Subject: [PATCH] (cksum): Use primitives from inttostr.h, not human.h, to print large numbers simply. --- src/cksum.c | 8 ++++---- 1 file 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]; -- 2.34.1