diff options
author | Volker Lendecke <vl@samba.org> | 2011-08-10 19:44:45 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2011-08-10 19:56:10 +0200 |
commit | c6ae297d613fc22b92c34d26c61ec1715058b484 (patch) | |
tree | 0f3932475983191fc8a7b4944660629ed6218058 | |
parent | 066d36a1a635e1115f62c452c49a9830d484c03b (diff) | |
download | samba-c6ae297d613fc22b92c34d26c61ec1715058b484.tar.gz samba-c6ae297d613fc22b92c34d26c61ec1715058b484.tar.bz2 samba-c6ae297d613fc22b92c34d26c61ec1715058b484.zip |
Adapt tally_new to Samba coding conventions
-rw-r--r-- | lib/ccan/tally/tally.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/ccan/tally/tally.c b/lib/ccan/tally/tally.c index a5eedcb951..d67112c2cf 100644 --- a/lib/ccan/tally/tally.c +++ b/lib/ccan/tally/tally.c @@ -25,12 +25,15 @@ struct tally *tally_new(unsigned buckets) struct tally *tally; /* There is always 1 bucket. */ - if (buckets == 0) + if (buckets == 0) { buckets = 1; + } /* Overly cautious check for overflow. */ - if (sizeof(*tally) * buckets / sizeof(*tally) != buckets) + if (sizeof(*tally) * buckets / sizeof(*tally) != buckets) { return NULL; + } + tally = (struct tally *)malloc( sizeof(*tally) + sizeof(tally->counts[0])*(buckets-1)); if (tally == NULL) { |