Browse Source

tally: Fix a c++ warning

(Imported from SAMBA commit 54282e9f4eda083e70c7e56dda2bf425209add6d)
Volker Lendecke 14 years ago
parent
commit
16a578430f
1 changed files with 2 additions and 1 deletions
  1. 2 1
      ccan/tally/tally.c

+ 2 - 1
ccan/tally/tally.c

@@ -31,7 +31,8 @@ struct tally *tally_new(unsigned buckets)
 	/* Overly cautious check for overflow. */
 	if (sizeof(*tally) * buckets / sizeof(*tally) != buckets)
 		return NULL;
-	tally = malloc(sizeof(*tally) + sizeof(tally->counts[0])*(buckets-1));
+	tally = (struct tally *)malloc(
+		sizeof(*tally) + sizeof(tally->counts[0])*(buckets-1));
 	if (tally) {
 		tally->max = ((size_t)1 << (SIZET_BITS - 1));
 		tally->min = ~tally->max;