[PATCH 11/24] stat.2: Remove unneeded cast

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

 



Both major(3) and minor(3) return an 'unsigned int',
so there is no need to use a 'long' for printing.
Moreover, it should have been 'unsigned long',
as "%lx" expects an unsigned type.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@xxxxxxxxx>
---
 man2/stat.2 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man2/stat.2 b/man2/stat.2
index b35e3c615..3418e1b5d 100644
--- a/man2/stat.2
+++ b/man2/stat.2
@@ -664,8 +664,8 @@ main(int argc, char *argv[])
         exit(EXIT_FAILURE);
     }
 
-    printf("ID of containing device:  [%lx,%lx]\en",
-	    (long) major(sb.st_dev), (long) minor(sb.st_dev));
+    printf("ID of containing device:  [%x,%x]\en",
+	    major(sb.st_dev), minor(sb.st_dev));
 
     printf("File type:                ");
 
-- 
2.28.0




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux