summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-11-26 20:42:38 +0100
committerChristian Göttsche <cgzones@googlemail.com>2020-11-26 20:42:38 +0100
commit46a2e8ac63fb758a589a82d4dca60de1aa0c1eb2 (patch)
treef7940dda9710392525318fe17fcd400496181cb1
parent15fe8717b16fdc58d81da303bedd3bc2f683fdcd (diff)
IOPriorityPanel: drop unnecessary buffer size decrement
xSnprintf guarantees null-termination within the passed size.
-rw-r--r--linux/IOPriorityPanel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/linux/IOPriorityPanel.c b/linux/IOPriorityPanel.c
index bd84241e..c5a4a4c9 100644
--- a/linux/IOPriorityPanel.c
+++ b/linux/IOPriorityPanel.c
@@ -35,7 +35,7 @@ Panel* IOPriorityPanel_new(IOPriority currPrio) {
for (int c = 0; classes[c].name; c++) {
for (int i = 0; i < 8; i++) {
char name[50];
- xSnprintf(name, sizeof(name) - 1, "%s %d %s", classes[c].name, i, i == 0 ? "(High)" : (i == 7 ? "(Low)" : ""));
+ xSnprintf(name, sizeof(name), "%s %d %s", classes[c].name, i, i == 0 ? "(High)" : (i == 7 ? "(Low)" : ""));
IOPriority ioprio = IOPriority_tuple(classes[c].klass, i);
Panel_add(this, (Object*) ListItem_new(name, ioprio));
if (currPrio == ioprio) {

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