From 270c5eb18f0682058bda5df1ac9c4553154cd4e9 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Tue, 9 Sep 2014 12:07:50 +0000 Subject: [PATCH] fixed histogram plotter for 0 git-svn-id: https://zerberus.eonerc.rwth-aachen.de:8443/svn/s2ss/trunk@229 8ec27952-4edc-4aab-86aa-e87bb2611832 --- server/src/utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/utils.c b/server/src/utils.c index b04003774..8289295a0 100644 --- a/server/src/utils.c +++ b/server/src/utils.c @@ -142,10 +142,10 @@ void hist_plot(unsigned *hist, int length) memset(buf, '#', sizeof(buf)); for (int i = 0; i < length; i++) { bar = HIST_HEIGHT * (float) hist[i] / hist[max]; - if (i == max) + if (hist[i] == hist[max]) info("%2u | " RED("%5u") " | " BLD("%.*s"), i, hist[i], bar, buf); else if (hist[i] == 0) - info("%2u | " GRN("%5u") " | " "%.*s", i, hist[i], bar, buf); + info("%2u | " GRN("%5u") " | " , i, hist[i]); else info("%2u | " "%5u" " | " "%.*s", i, hist[i], bar, buf); }