From 737ce2e5e24b842ae5b636c01e97347b9f14f835 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Fri, 22 Jan 2016 13:57:42 +0100 Subject: [PATCH] Move format specific code to its corresponding function Incrementing tab variable was specific to XML output. So move this code to the f_timestamp function used by XML output format, so that thee main code remains generic. Signed-off-by: Sebastien GODARD --- sadf.c | 3 --- sadf_misc.c | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/sadf.c b/sadf.c index 9020758..b818251 100644 --- a/sadf.c +++ b/sadf.c @@ -649,9 +649,6 @@ int logic1_write_stats(int curr, int use_tm_start, int use_tm_end, int reset, !PRINT_LOCAL_TIME(flags) && !PRINT_TRUE_TIME(flags), dt); } - if (format == F_XML_OUTPUT) { - tab++; - } /* Display statistics */ for (i = 0; i < NR_ACT; i++) { diff --git a/sadf_misc.c b/sadf_misc.c index 7a5ed16..8159e24 100644 --- a/sadf_misc.c +++ b/sadf_misc.c @@ -426,7 +426,7 @@ __printf_funct_t print_xml_timestamp(int *tab, int action, char *cur_date, char *cur_time, int utc, unsigned long long itv) { if (action & F_BEGIN) { - xprintf(*tab, "", + xprintf((*tab)++, "", cur_date, cur_time, utc ? 1 : 0, itv); } if (action & F_END) { -- 2.50.0