bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] finfo.c: Fix -Wformat warnings


From: Jessica Clarke
Subject: [PATCH] finfo.c: Fix -Wformat warnings
Date: Sat, 27 Jun 2020 21:09:25 +0100

We must cast these to unsigned long like the surrounding code.
---
 examples/loadables/finfo.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/examples/loadables/finfo.c b/examples/loadables/finfo.c
index 4273aa59..92e98008 100644
--- a/examples/loadables/finfo.c
+++ b/examples/loadables/finfo.c
@@ -334,13 +334,13 @@ int       flags;
                else
                        printf("%ld\n", st->st_ctime);
        } else if (flags & OPT_DEV)
-               printf("%d\n", st->st_dev);
+               printf("%lu\n", (unsigned long)st->st_dev);
        else if (flags & OPT_INO)
                printf("%lu\n", (unsigned long)st->st_ino);
        else if (flags & OPT_FID)
-               printf("%d:%lu\n", st->st_dev, (unsigned long)st->st_ino);
+               printf("%lu:%lu\n", (unsigned long)st->st_dev, (unsigned 
long)st->st_ino);
        else if (flags & OPT_NLINK)
-               printf("%d\n", st->st_nlink);
+               printf("%lu\n", (unsigned long)st->st_nlink);
        else if (flags & OPT_LNKNAM) {
 #ifdef S_ISLNK
                b = xmalloc(4096);
-- 
2.20.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]