summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2022-06-03 23:42:22 +0200
committerBenBE <BenBE@geshi.org>2022-06-23 00:07:01 +0200
commit393796d75da57983710f8bfdacd272f773fad47b (patch)
tree7d268227c7329cf3eff9251956797b8812c50ce0
parent611ea4606f8538abf9c3db839f13c52dbc3a9605 (diff)
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 */ ~~~~~~~~ ^~~~~~~~~~
-rw-r--r--OpenFilesScreen.c2
1 files changed, 1 insertions, 1 deletions
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);
}
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy