From 237fc67d26def3f4458594b4aff7cb617f4522f7 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 10 Aug 2011 19:44:45 +0200 Subject: [PATCH] tally: Adapt tally_new to Samba coding conventions (Imported from SAMBA commit c6ae297d613fc22b92c34d26c61ec1715058b484) --- ccan/tally/tally.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ccan/tally/tally.c b/ccan/tally/tally.c index a5eedcb9..d67112c2 100644 --- a/ccan/tally/tally.c +++ b/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) { -- 2.39.2