From 393796d75da57983710f8bfdacd272f773fad47b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Fri, 3 Jun 2022 23:42:22 +0200 Subject: Fix format specifier warning on 32 bit OpenFilesScreen.c:229:65: error: format specifies type 'unsigned long long' but the argument has type '__off_t' (aka 'long') [-Werror,-Wformat] xSnprintf(fileSizeBuf, sizeof(fileSizeBuf), "%"PRIu64, st.st_size); /* st.st_size is long long on macOS, long on linux */ ~~~~~~~~ ^~~~~~~~~~ --- OpenFilesScreen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenFilesScreen.c b/OpenFilesScreen.c index 787e17b9..4256575c 100644 --- a/OpenFilesScreen.c +++ b/OpenFilesScreen.c @@ -226,7 +226,7 @@ static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) { struct stat st; if (stat(filename, &st) == 0) { char fileSizeBuf[21]; /* 20 (long long) + 1 (NULL) */ - xSnprintf(fileSizeBuf, sizeof(fileSizeBuf), "%"PRIu64, st.st_size); /* st.st_size is long long on macOS, long on linux */ + xSnprintf(fileSizeBuf, sizeof(fileSizeBuf), "%"PRIu64, (uint64_t)st.st_size); /* st.st_size is long long on macOS, long on linux */ free_and_xStrdup(&item->data[fileSizeIndex], fileSizeBuf); } } -- cgit v1.2.3