diff options
-rw-r--r-- | toys/other/vmstat.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/toys/other/vmstat.c b/toys/other/vmstat.c index 9a38e452..5b79702b 100644 --- a/toys/other/vmstat.c +++ b/toys/other/vmstat.c @@ -96,14 +96,14 @@ void vmstat_main(void) // Print headers if (rows>3 && !(loop % (rows-3))) { + const char *header = headers; if (isatty(1)) terminal_size(0, &rows); else rows = 0; printf("procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----\n"); - for (i=0; i<sizeof(lengths); i++) { - printf(" %*s"+!i, lengths[i], headers); - headers += strlen(headers)+1; + printf(" %*s"+!i, lengths[i], header); + header += strlen(header)+1; } xputc('\n'); } |