From 236b956c692d35571f61c9df0aa36e0b390f6a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Skytte=20J=C3=B8rgensen?= Date: Thu, 8 Jun 2017 14:14:50 +0200 Subject: [PATCH] Use wide columns for r/b too in wide mode 2 digits are not enough for number of runnable/blocked processes on modern systems. Changed to 4 digits with given the -w option. References: procps-ng/procps!48 --- vmstat.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vmstat.c b/vmstat.c index 27d2b26a..0551a994 100644 --- a/vmstat.c +++ b/vmstat.c @@ -241,7 +241,7 @@ static void new_header(void) const char *header = _("procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----"); const char *wide_header = - _("procs -----------------------memory---------------------- ---swap-- -----io---- -system-- --------cpu--------"); + _("--procs-- -----------------------memory---------------------- ---swap-- -----io---- -system-- --------cpu--------"); const char *timestamp_header = _(" -----timestamp-----"); const char format[] = @@ -260,9 +260,9 @@ static void new_header(void) printf( w_option ? wide_format : format, - /* Translation Hint: max 2 chars */ + /* Translation Hint: max 4 chars */ _("r"), - /* Translation Hint: max 2 chars */ + /* Translation Hint: max 4 chars */ _("b"), /* Translation Hint: max 6 chars */ _("swpd"), @@ -334,7 +334,7 @@ static void new_format(void) const char format[] = "%2lu %2lu %6lu %6lu %6lu %6lu %4u %4u %5u %5u %4u %4u %2u %2u %2u %2u %2u"; const char wide_format[] = - "%2lu %2lu %12lu %12lu %12lu %12lu %4u %4u %5u %5u %4u %4u %3u %3u %3u %3u %3u"; + "%4lu %4lu %12lu %12lu %12lu %12lu %4u %4u %5u %5u %4u %4u %3u %3u %3u %3u %3u"; unsigned int tog = 0; /* toggle switch for cleaner code */ unsigned int i;