Please find here an alternate proposal for fixing that issue.
Best regards
José


diff --git a/toys/other/vmstat.c b/toys/other/vmstat.c
index eed7945..0884fe9 100644
--- a/toys/other/vmstat.c
+++ b/toys/other/vmstat.c
@@ -93,14 +93,15 @@ void vmstat_main(void)
 
     // Print headers
     if (rows>3 && !(loop % (rows-3))) {
+      char *h = 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], h++);
+        while(*h++ != 0);
       }
       xputc('\n');
     }



_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to