diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-11-28 19:33:07 +0100 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2020-11-28 19:33:07 +0100 |
commit | ea4f33409a978140493a43567fa3a3454ab03479 (patch) | |
tree | 80ed4da77c2c5a69410a32a96f78fea643c61e7d /linux | |
parent | 7899ae2eb1ec23f5315aee4a2601cbb95bdbf4c2 (diff) |
Update even more snprintfs
Use size of actual buffers instead of magic numbers
Diffstat (limited to 'linux')
-rw-r--r-- | linux/Platform.c | 4 |
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; |