From 89089f21c3b5be707cff0aa6bd8b94bcbc11538d Mon Sep 17 00:00:00 2001 From: Darafei Praliaskouski Date: Sat, 9 May 2026 13:40:57 +0400 Subject: [PATCH] csv: omit trailing empty header field --- ui/report.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ui/report.c b/ui/report.c index 43bf48c..c8c7dde 100644 --- a/ui/report.c +++ b/ui/report.c @@ -570,10 +570,10 @@ void csv_close( snprint_hop_name(ctl, name, sizeof(name), at, addr); if (at == net_min(ctl)) { - printf("Mtr_Version,Start_Time,Status,Host,Hop,Ip,"); + printf("Mtr_Version,Start_Time,Status,Host,Hop,Ip"); #ifdef HAVE_IPINFO if (ipinfo_field_selected(ctl, 0)) { - printf("Asn,"); + printf(",Asn"); } #endif for (i = 0; i < MAXFLD; i++) { @@ -584,7 +584,7 @@ void csv_close( printf(","); continue; } - printf("%s,", data_fields[j].title); + printf(",%s", data_fields[j].title); } printf("\n"); } @@ -608,7 +608,6 @@ void csv_close( printf(","); continue; } - /* 1000.0 is a temporary hack for stats usec to ms, impacted net_loss. */ if (strchr(data_fields[j].format, 'f')) { printf(",%.2f", @@ -665,7 +664,6 @@ void csv_close( printf(","); continue; } - /* 1000.0 is a temporary hack for stats usec to ms, impacted net_loss. */ if (strchr(data_fields[j].format, 'f')) { printf(",%.2f", -- 2.47.3