From 704d8aaffbcb0dd2970a460aaef4cb271dd5c215 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Fri, 6 Feb 2015 13:27:47 +0000 Subject: [PATCH] Don't try to log signal peak power if no peaks recorded. --- stats.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stats.c b/stats.c index 6ffbc82..59e0eff 100644 --- a/stats.c +++ b/stats.c @@ -96,8 +96,10 @@ void display_stats(struct stats *st) { 10 * log10(st->signal_power_sum / st->signal_power_count)); } - printf(" %.1f dBFS peak signal power\n", - 10 * log10(st->peak_signal_power)); + if (st->peak_signal_power) { + printf(" %.1f dBFS peak signal power\n", + 10 * log10(st->peak_signal_power)); + } printf(" %u messages with signal power above -3dBFS\n", st->strong_signal_count);