From ac29f8e34da9b763af9eb052c5724d4c911931fd Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Thu, 23 Jun 2005 12:18:26 +0000 Subject: (print_stat): Use umaxstr --- tests/genfile.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/genfile.c b/tests/genfile.c index 081ba59..4ae3cee 100644 --- a/tests/genfile.c +++ b/tests/genfile.c @@ -29,6 +29,7 @@ #include #include #include +#include #ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -433,6 +434,7 @@ print_stat (const char *name) { char *fmt, *p; struct stat st; + char buf[UINTMAX_STRSIZE_BOUND]; if (stat (name, &st)) { @@ -460,11 +462,11 @@ print_stat (const char *name) else if (strcmp (p, "gid") == 0) printf ("%lu", (unsigned long) st.st_gid); else if (strcmp (p, "size") == 0) - printf ("%lu", (unsigned long) st.st_size); + printf ("%s", umaxtostr (st.st_size, buf)); else if (strcmp (p, "blksize") == 0) - printf ("%lu", (unsigned long) st.st_blksize); + printf ("%s", umaxtostr (st.st_blksize, buf)); else if (strcmp (p, "blocks") == 0) - printf ("%lu", (unsigned long) st.st_blocks); + printf ("%s", umaxtostr (st.st_blocks, buf)); else if (strcmp (p, "atime") == 0) printf ("%lu", (unsigned long) st.st_atime); else if (strcmp (p, "atimeH") == 0) -- cgit v1.2.1