summaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-11-28 19:33:07 +0100
committerChristian Göttsche <cgzones@googlemail.com>2020-11-28 19:33:07 +0100
commitea4f33409a978140493a43567fa3a3454ab03479 (patch)
tree80ed4da77c2c5a69410a32a96f78fea643c61e7d /linux
parent7899ae2eb1ec23f5315aee4a2601cbb95bdbf4c2 (diff)
Update even more snprintfs
Use size of actual buffers instead of magic numbers
Diffstat (limited to 'linux')
-rw-r--r--linux/Platform.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/linux/Platform.c b/linux/Platform.c
index 82354717..ff4fcf69 100644
--- a/linux/Platform.c
+++ b/linux/Platform.c
@@ -476,8 +476,8 @@ FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) {
void Platform_getPressureStall(const char* file, bool some, double* ten, double* sixty, double* threehundred) {
*ten = *sixty = *threehundred = 0;
- char procname[128 + 1];
- xSnprintf(procname, 128, PROCDIR "/pressure/%s", file);
+ char procname[128];
+ xSnprintf(procname, sizeof(procname), PROCDIR "/pressure/%s", file);
FILE* fd = fopen(procname, "r");
if (!fd) {
*ten = *sixty = *threehundred = NAN;

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