Thread (1 message) 1 message, 1 author, 2016-05-09

Re: [PATCH 1/1] ioctl_fat.2: use %04x to print volume id

From: Michael Kerrisk (man-pages) <hidden>
Date: 2016-05-09 20:26:16

Possibly related (same subject, not in this thread)

On 05/07/2016 10:42 AM, Heinrich Schuchardt wrote:
Leading zeroes should be used when display a FAT volume id.
Thanks, Heinrich. Applied.

Cheers,

Michael

quoted hunk
Signed-off-by: Heinrich Schuchardt <redacted>
---
 man2/ioctl_fat.2 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/man2/ioctl_fat.2 b/man2/ioctl_fat.2
index 4ae0e5d..875b57e 100644
--- a/man2/ioctl_fat.2
+++ b/man2/ioctl_fat.2
@@ -111,7 +111,7 @@ Typically the volume label is displayed to the user as a group of two
 .PP
 .in +4n
 .nf
-printf("Volume ID %4x-%4x\\n", id >> 16, id & 0xFFFF);
+printf("Volume ID %04x-%04x\\n", id >> 16, id & 0xFFFF);
 .fi
 .in
 .SS Reading short file names of a directory
@@ -403,7 +403,7 @@ main(int argc, char *argv[])
     /*
      * Format the output as two groups of 16 bits each.
      */
-    printf("Volume ID %4x\-%4x\\n", id >> 16, id & 0xFFFF);
+    printf("Volume ID %04x\-%04x\\n", id >> 16, id & 0xFFFF);
 
     close(fd);
 

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help