From 3dc6054e2a1f28b290b8beb01e9fc2574a76a52a Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Wed, 13 May 2009 13:31:46 -0500 Subject: [PATCH] fsx: Use %ll instead of %q in printf format statements The ISO C approved way of printing long long variables is %ll. The %q length modifier was used in BSD 4.4 and Linux libc5, and its use is discouraged as non-standards compliant. Signed-off-by: "Theodore Ts'o" Signed-off-by: Eric Sandeen --- ltp/fsx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ltp/fsx.c b/ltp/fsx.c index 50250bf5..0bd5d919 100644 --- a/ltp/fsx.c +++ b/ltp/fsx.c @@ -298,7 +298,7 @@ save_buffer(char *buffer, off_t bufferlength, int fd) if (size_by_seek == (off_t)-1) prterr("save_buffer: lseek eof"); else if (bufferlength > size_by_seek) { - warn("save_buffer: .fsxgood file too short... will save 0x%qx bytes instead of 0x%qx\n", (unsigned long long)size_by_seek, + warn("save_buffer: .fsxgood file too short... will save 0x%llx bytes instead of 0x%llx\n", (unsigned long long)size_by_seek, (unsigned long long)bufferlength); bufferlength = size_by_seek; } @@ -313,7 +313,7 @@ save_buffer(char *buffer, off_t bufferlength, int fd) if (byteswritten == -1) prterr("save_buffer write"); else - warn("save_buffer: short write, 0x%x bytes instead of 0x%qx\n", + warn("save_buffer: short write, 0x%x bytes instead of 0x%llx\n", (unsigned)byteswritten, (unsigned long long)bufferlength); } @@ -397,7 +397,7 @@ check_size(void) } size_by_seek = lseek(fd, (off_t)0, SEEK_END); if (file_size != statbuf.st_size || file_size != size_by_seek) { - prt("Size error: expected 0x%qx stat 0x%qx seek 0x%qx\n", + prt("Size error: expected 0x%llx stat 0x%llx seek 0x%llx\n", (unsigned long long)file_size, (unsigned long long)statbuf.st_size, (unsigned long long)size_by_seek); @@ -750,12 +750,12 @@ writefileimage() if (iret == -1) prterr("writefileimage: write"); else - prt("short write: 0x%x bytes instead of 0x%qx\n", + prt("short write: 0x%x bytes instead of 0x%llx\n", iret, (unsigned long long)file_size); report_failure(172); } if (lite ? 0 : ftruncate(fd, file_size) == -1) { - prt("ftruncate2: %qx\n", (unsigned long long)file_size); + prt("ftruncate2: %llx\n", (unsigned long long)file_size); prterr("writefileimage: ftruncate"); report_failure(173); } -- 2.47.3