git.samba.org
/
obnox
/
samba
/
samba-obnox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
066d36a
)
Adapt tally_new to Samba coding conventions
author
Volker Lendecke
<vl@samba.org>
Wed, 10 Aug 2011 17:44:45 +0000
(19:44 +0200)
committer
Volker Lendecke
<vl@samba.org>
Wed, 10 Aug 2011 17:56:10 +0000
(19:56 +0200)
lib/ccan/tally/tally.c
patch
|
blob
|
history
diff --git
a/lib/ccan/tally/tally.c
b/lib/ccan/tally/tally.c
index a5eedcb951bfafc819701a740bcad64e68f162ac..d67112c2cf6da49017904be9ec91b49f1f11ced5 100644
(file)
--- 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) {