From: Jaromir Capik Date: Wed, 5 Feb 2014 16:09:45 +0000 (+0100) Subject: vmstat: Fixing format-security flaws X-Git-Tag: v3.3.10~106 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dc072aced7250fed9b01fb05f0d672678752a63e;p=procps-ng vmstat: Fixing format-security flaws Previously the headers were printed directly without the format specifier. That way is considered insecure and leads to build errors with -Werror=format-security flag set. --- diff --git a/vmstat.c b/vmstat.c index a84d2d27..a2fd3512 100644 --- a/vmstat.c +++ b/vmstat.c @@ -204,10 +204,10 @@ static void new_header(void) "%2s %2s %12s %12s %12s %12s %4s %4s %5s %5s %4s %4s %3s %3s %3s %3s %3s"; - printf(w_option ? wide_header : header); + printf("%s", w_option ? wide_header : header); if (t_option) { - printf(timestamp_header); + printf("%s", timestamp_header); } printf("\n"); @@ -528,10 +528,10 @@ static void diskheader(void) const char wide_format[] = "%5s %9s %9s %11s %11s %9s %9s %11s %11s %7s %7s"; - printf(w_option ? wide_header : header); + printf("%s", w_option ? wide_header : header); if (t_option) { - printf(timestamp_header); + printf("%s", timestamp_header); } printf("\n");