summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2005-06-23 12:18:26 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2005-06-23 12:18:26 +0000
commitac29f8e34da9b763af9eb052c5724d4c911931fd (patch)
tree79e3eaa063ce4961d4c5511324de170701a31164 /tests
parent53fa1be9b65f01469eafcc7c57499d73e35715a7 (diff)
downloadpaxutils-ac29f8e34da9b763af9eb052c5724d4c911931fd.tar.gz
(print_stat): Use umaxstr
Diffstat (limited to 'tests')
-rw-r--r--tests/genfile.c8
1 files changed, 5 insertions, 3 deletions
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 <argp.h>
#include <argcv.h>
#include <utimens.h>
+#include <inttostr.h>
#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)