From de1f909a3779c72e576642dd5f13b8c413f0e66f Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 12 Nov 2017 07:28:01 +0000 Subject: [PATCH] Don't output segmatch stats when cnt_candidates is zero Signed-off-by: Clifford Wolf Signed-off-by: Tim 'mithro' Ansell --- tools/segmatch.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/segmatch.cc b/tools/segmatch.cc index 4c5f2a20..5616f764 100644 --- a/tools/segmatch.cc +++ b/tools/segmatch.cc @@ -311,9 +311,12 @@ help: printf("#of const0 tags: %d\n", cnt_const0); printf("#of const1 tags: %d\n", cnt_const1); - printf("min #of candidates: %d\n", min_candidates); - printf("max #of candidates: %d\n", max_candidates); - printf("avg #of candidates: %.3f\n", avg_candidates); + + if (cnt_candidates) { + printf("min #of candidates: %d\n", min_candidates); + printf("max #of candidates: %d\n", max_candidates); + printf("avg #of candidates: %.3f\n", avg_candidates); + } return 0; }