IOPriorityPanel: drop unnecessary buffer size decrement

xSnprintf guarantees null-termination within the passed size.
This commit is contained in:
Christian Göttsche 2020-11-26 20:42:38 +01:00
parent 15fe8717b1
commit 46a2e8ac63
1 changed files with 1 additions and 1 deletions

View File

@ -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) {