diff options
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/node.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/base/node.c b/drivers/base/node.c index 90aa2a11a933..af1a177216f1 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c | |||
@@ -592,11 +592,9 @@ static ssize_t print_nodes_state(enum node_states state, char *buf) | |||
592 | { | 592 | { |
593 | int n; | 593 | int n; |
594 | 594 | ||
595 | n = nodelist_scnprintf(buf, PAGE_SIZE, node_states[state]); | 595 | n = nodelist_scnprintf(buf, PAGE_SIZE-2, node_states[state]); |
596 | if (n > 0 && PAGE_SIZE > n + 1) { | 596 | buf[n++] = '\n'; |
597 | *(buf + n++) = '\n'; | 597 | buf[n] = '\0'; |
598 | *(buf + n++) = '\0'; | ||
599 | } | ||
600 | return n; | 598 | return n; |
601 | } | 599 | } |
602 | 600 | ||