[minicoredumper] [PATCH 1/1] minicoredumper: dump_compressed_tar: fix hdr.mtime warning

Marco Felsch Marco.Felsch at preh.de
Wed Aug 2 13:11:34 CEST 2017


Correct assignment to long int.

corestripper.c:1244:47: error: format '%lo' expects argument of type 'long unsigned int',
but argument 4 has type 'long long int' [-Werror=format=]

  snprintf(hdr.mtime, sizeof(hdr.mtime), "%011lo",
                                               ^
Signed-off-by: Marco Felsch <Marco.Felsch at preh.de>
---
 src/minicoredumper/corestripper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/minicoredumper/corestripper.c b/src/minicoredumper/corestripper.c
index 7d46af1..9b57d97 100644
--- a/src/minicoredumper/corestripper.c
+++ b/src/minicoredumper/corestripper.c
@@ -1242,7 +1242,7 @@ static int dump_compressed_tar(struct dump_info *di)
 	snprintf(hdr.uid, sizeof(hdr.uid), "%07o", 0);
 	snprintf(hdr.gid, sizeof(hdr.gid), "%07o", 0);
 	snprintf(hdr.mtime, sizeof(hdr.mtime), "%011lo",
-		 (long long)time(NULL));
+		 (long unsigned)time(NULL));
 	memset(hdr.checksum, ' ', sizeof(hdr.checksum));
 	hdr.type = 'S';
 	memcpy(hdr.magic, "ustar ", 6);
-- 
2.11.0




More information about the minicoredumper mailing list