From: Volker Lendecke Date: Wed, 10 Aug 2011 17:52:15 +0000 (+0200) Subject: tally: Adapt bucket_range to Samba coding conventions X-Git-Url: https://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=ce3198f06194b9ccd9a5d7653daa109175e1226b;hp=6697a3dde2b3e1aa180622bd5f909bba3a8fd948 tally: Adapt bucket_range to Samba coding conventions (Imported from SAMBA commit eac2f44cde39d16b827b7e2d360f7a7fb1d940e5) --- diff --git a/ccan/tally/tally.c b/ccan/tally/tally.c index e166dd03..936b5142 100644 --- a/ccan/tally/tally.c +++ b/ccan/tally/tally.c @@ -367,10 +367,11 @@ static ssize_t bucket_range(const struct tally *tally, unsigned b, size_t *err) ssize_t min, max; min = bucket_min(tally->min, tally->step_bits, b); - if (b == tally->buckets - 1) + if (b == tally->buckets - 1) { max = tally->max; - else + } else { max = bucket_min(tally->min, tally->step_bits, b+1) - 1; + } /* FIXME: Think harder about cumulative error; is this enough?. */ *err = (max - min + 1) / 2;