From b0f9d3305850bdcce171b53e7bbbc9628a4e3c20 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Thu, 4 Sep 2014 11:21:24 +1000 Subject: [PATCH] ctdb: Fix some "declarations after code" problems Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/lib/util/db_wrap.c | 2 +- ctdb/server/ctdb_recover.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ctdb/lib/util/db_wrap.c b/ctdb/lib/util/db_wrap.c index 1b2bf7e2281..bc174a42a84 100644 --- a/ctdb/lib/util/db_wrap.c +++ b/ctdb/lib/util/db_wrap.c @@ -47,8 +47,8 @@ static void log_fn(struct tdb_context *tdb, enum tdb_debug_level level, const ch { if (level <= TDB_DEBUG_ERROR) { va_list ap; - this_log_level = level; char newfmt[strlen(tdb_name(tdb)) + 1 + strlen(fmt) + 1]; + this_log_level = level; sprintf(newfmt, "%s:%s", tdb_name(tdb), fmt); va_start(ap, fmt); do_debug_v(newfmt, ap); diff --git a/ctdb/server/ctdb_recover.c b/ctdb/server/ctdb_recover.c index d45b7f6c5b5..d033b2126e2 100644 --- a/ctdb/server/ctdb_recover.c +++ b/ctdb/server/ctdb_recover.c @@ -31,10 +31,11 @@ int ctdb_control_getvnnmap(struct ctdb_context *ctdb, uint32_t opcode, TDB_DATA indata, TDB_DATA *outdata) { - CHECK_CONTROL_DATA_SIZE(0); struct ctdb_vnn_map_wire *map; size_t len; + CHECK_CONTROL_DATA_SIZE(0); + len = offsetof(struct ctdb_vnn_map_wire, map) + sizeof(uint32_t)*ctdb->vnn_map->size; map = talloc_size(outdata, len); CTDB_NO_MEMORY(ctdb, map);