summaryrefslogtreecommitdiffstats
path: root/OpenFilesScreen.c
diff options
context:
space:
mode:
authorExplorer09 <explorer09@gmail.com>2024-04-17 16:50:34 +0800
committerBenBE <BenBE@geshi.org>2024-04-17 11:54:00 +0200
commit7017b86bbfafe14859d0fa94ec89351ee167db9e (patch)
treed08e55b1b7898fa1613ac8071217ac31836d5e43 /OpenFilesScreen.c
parenta46b3f0a98c801b94df08598be0127e4d7db2aca (diff)
Use 'sb' name for local 'struct stat' buffers
Deprecate the use of 'st' and other names. The 'sb' name is often seen in example codes in Linux man pages. (The 'statbuf' name is sometimes also used but I choose 'sb' name because it's shorter.) No code changes.
Diffstat (limited to 'OpenFilesScreen.c')
-rw-r--r--OpenFilesScreen.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/OpenFilesScreen.c b/OpenFilesScreen.c
index 08b3b3d6..d04cce76 100644
--- a/OpenFilesScreen.c
+++ b/OpenFilesScreen.c
@@ -238,10 +238,10 @@ static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) {
item = &fdata->data;
const char* filename = getDataForType(item, 'n');
- struct stat st;
- if (stat(filename, &st) == 0) {
+ struct stat sb;
+ if (stat(filename, &sb) == 0) {
char fileSizeBuf[21]; /* 20 (long long) + 1 (NULL) */
- xSnprintf(fileSizeBuf, sizeof(fileSizeBuf), "%"PRIu64, (uint64_t)st.st_size); /* st.st_size is long long on macOS, long on linux */
+ xSnprintf(fileSizeBuf, sizeof(fileSizeBuf), "%"PRIu64, (uint64_t)sb.st_size); /* sb.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