Commit a9106e8a authored by Pekka Pessi's avatar Pekka Pessi

Fixed bug in histogram bucket search.

Bug was detected using coverity.

darcs-hash:20051219122600-65a35-57b1e9f482ce8717452171d89af53a43e5521fe0.gz
parent bc1b224d
......@@ -554,11 +554,11 @@ void report_histogram(char const *title, histogram_t const *h)
{
int i, min_i, max_i;
for (i = 0; h->buckets[i] == 0.0 && i < h->N; i++)
for (i = 0; i < h->N && h->buckets[i] == 0.0; i++)
;
min_i = i;
for (i = h->N - 1; h->buckets[i] == 0.0 && i >= 0; i--)
for (i = h->N - 1; i >= 0 && h->buckets[i] == 0.0; i--)
;
max_i = i;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment