mirror of https://github.com/xzeldon/htop.git
IOPriorityPanel: drop unnecessary buffer size decrement
xSnprintf guarantees null-termination within the passed size.
This commit is contained in:
parent
15fe8717b1
commit
46a2e8ac63
|
@ -35,7 +35,7 @@ Panel* IOPriorityPanel_new(IOPriority currPrio) {
|
||||||
for (int c = 0; classes[c].name; c++) {
|
for (int c = 0; classes[c].name; c++) {
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
char name[50];
|
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);
|
IOPriority ioprio = IOPriority_tuple(classes[c].klass, i);
|
||||||
Panel_add(this, (Object*) ListItem_new(name, ioprio));
|
Panel_add(this, (Object*) ListItem_new(name, ioprio));
|
||||||
if (currPrio == ioprio) {
|
if (currPrio == ioprio) {
|
||||||
|
|
Loading…
Reference in New Issue