From 29e8f76c238da830267b00f1bf20285710347705 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Mon, 29 Aug 2016 00:55:24 +0100 Subject: [PATCH] crash fix: make --xml not to dump core This also makes --report option to print values rather than %5N. And in same go remove a floating point exception. Crash these issues were introduced in caad4c42fb8ef0d830fd37608a96702d6774f93f --- mtr.c | 4 ++-- report.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mtr.c b/mtr.c index 437e1e4..17ae265 100644 --- a/mtr.c +++ b/mtr.c @@ -70,8 +70,8 @@ struct fields data_fields[MAXFLD] = { {' ', ": Space between fields", " ", " ", 1, &net_drop }, {'L', "L: Loss Ratio", "Loss%", " %4.1f%%", 6, &net_loss }, {'D', "D: Dropped Packets", "Drop", " %4d", 5, &net_drop }, - {'R', "R: Received Packets", "Rcv", " %5N", 6, &net_returned}, - {'S', "S: Sent Packets", "Snt", " %5N", 6, &net_xmit }, + {'R', "R: Received Packets", "Rcv", " %5d", 6, &net_returned}, + {'S', "S: Sent Packets", "Snt", " %5d", 6, &net_xmit }, {'N', "N: Newest RTT(ms)", "Last", " %5.1f", 6, &net_last }, {'B', "B: Min/Best RTT(ms)", "Best", " %5.1f", 6, &net_best }, {'A', "A: Average RTT(ms)", "Avg", " %5.1f", 6, &net_avg }, diff --git a/report.c b/report.c index 61b09e4..86fdab0 100644 --- a/report.c +++ b/report.c @@ -97,7 +97,7 @@ extern void report_close(struct mtr_ctl *ctl) #ifdef HAVE_IPINFO int len_tmp = len_hosts; - if (ctl->ipinfo_no >= 0) { + if (ctl->ipinfo_no >= 0 && ctl->iiwidth_len) { ctl->ipinfo_no %= ctl->iiwidth_len; if (ctl->reportwide) { len_hosts++; // space -- 2.47.2