Commit 16a57843 authored by Volker Lendecke's avatar Volker Lendecke Committed by Rusty Russell

tally: Fix a c++ warning

(Imported from SAMBA commit 54282e9f4eda083e70c7e56dda2bf425209add6d)
parent 8a6147a9
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment