From 6e2c692cf0198d446fcc9a1d3db4b2d19aed4b56 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Sat, 16 Mar 2019 14:51:07 +0100 Subject: [PATCH] sar/sadf: Fix local variables hiding global ones. Signed-off-by: Sebastien GODARD --- pr_stats.c | 6 +++--- sadf.c | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pr_stats.c b/pr_stats.c index e2e6596..b8f24c6 100644 --- a/pr_stats.c +++ b/pr_stats.c @@ -46,7 +46,7 @@ extern unsigned long avg_count; * Display current activity header line. * * IN: - * @timestamp Timestamp for previous stat sample. + * @p_timestamp Timestamp for previous stat sample. * @a Activity structure. * @pos Index in @.hdr_line string, 0 being the first one (header * are delimited by the '|' character). @@ -56,7 +56,7 @@ extern unsigned long avg_count; * @vwidth Column width for stats values. *************************************************************************** */ -void print_hdr_line(char *timestamp, struct activity *a, int pos, int iwidth, int vwidth) +void print_hdr_line(char *p_timestamp, struct activity *a, int pos, int iwidth, int vwidth) { char hline[HEADER_LINE_LEN] = ""; char *hl, *tk, *it = NULL; @@ -70,7 +70,7 @@ void print_hdr_line(char *timestamp, struct activity *a, int pos, int iwidth, in /* Bad @pos arg given to function */ return; - printf("\n%-11s", timestamp); + printf("\n%-11s", p_timestamp); if (strchr(hl, '&')) { j = strcspn(hl, "&"); diff --git a/sadf.c b/sadf.c index 4ca6a02..234274c 100644 --- a/sadf.c +++ b/sadf.c @@ -126,14 +126,13 @@ void init_structures(void) * Look for output format in array. * * IN: - * @fmt Array of output formats. * @format Output format to look for. * * RETURNS: * Position of output format in array. *************************************************************************** */ -int get_format_position(struct report_format *fmt[], unsigned int format) +int get_format_position(unsigned int format) { int i; @@ -169,7 +168,7 @@ void check_format_options(void) } /* Get format position in array */ - f_position = get_format_position(fmt, format); + f_position = get_format_position(format); /* Check options consistency wrt output format */ if (!ACCEPT_HEADER_ONLY(fmt[f_position]->options)) { -- 2.40.0