From: Martin Schwenke Date: Wed, 22 May 2013 10:56:03 +0000 (+1000) Subject: recoverd: Use talloc_array_length() for simpler code X-Git-Url: http://git.samba.org/?p=obnox%2Fctdb.git;a=commitdiff_plain;h=f6792f478197774d2f3b2258c969b67c83e017ab recoverd: Use talloc_array_length() for simpler code Signed-off-by: Martin Schwenke --- diff --git a/server/ctdb_takeover.c b/server/ctdb_takeover.c index d8e77dfb..cf4f150e 100644 --- a/server/ctdb_takeover.c +++ b/server/ctdb_takeover.c @@ -1357,7 +1357,7 @@ static int find_takeover_node(struct ctdb_context *ctdb, int pnn, min=0, num; int i, numnodes; - numnodes = talloc_get_size(ipflags) / sizeof(struct ctdb_ipflags); + numnodes = talloc_array_length(ipflags); pnn = -1; for (i=0;iout) / sizeof(uint32_t); + size = talloc_array_length(cd->out); if (pnn >= size) { DEBUG(DEBUG_ERR,("Got %s reply from node %d but nodemap only has %d entries\n", cd->tunable, pnn, size));