From: Sebastien GODARD Date: Fri, 22 Jan 2016 12:57:42 +0000 (+0100) Subject: Move format specific code to its corresponding function X-Git-Tag: v11.3.1~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=737ce2e5e24b842ae5b636c01e97347b9f14f835;p=sysstat 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 --- 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) {