X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb%2Fsummary.c;h=3404a4144f8e78df40bb3e2c6e05c98463183f8b;hb=4116b284c098f6c67f62d8292e93d8f73d833e9d;hp=b8f7f97624ce69d22533688282410b30d9cf953b;hpb=43d881a232a4999e0d23db8e4335604dd5f3474a;p=ccan diff --git a/ccan/tdb/summary.c b/ccan/tdb/summary.c index b8f7f976..3404a414 100644 --- a/ccan/tdb/summary.c +++ b/ccan/tdb/summary.c @@ -19,7 +19,7 @@ #include #define SUMMARY_FORMAT \ - "Size of file/data: %zu/%zu\n" \ + "Size of file/data: %u/%zu\n" \ "Number of records: %zu\n" \ "Smallest/average/largest keys: %zu/%zu/%zu\n%s" \ "Smallest/average/largest data: %zu/%zu/%zu\n%s" \ @@ -81,6 +81,8 @@ char *tdb_summary(struct tdb_context *tdb, enum tdb_summary_flags flags) bool locked; size_t len, unc = 0; + freeg = keysg = datag = deadg = extrag = hashg = uncoalg = NULL; + /* Read-only databases use no locking at all: it's best-effort. * We may have a write lock already, so skip that case too. */ if (tdb->read_only || tdb->allrecord_lock.count != 0) { @@ -156,8 +158,6 @@ char *tdb_summary(struct tdb_context *tdb, enum tdb_summary_flags flags) extrag = tally_histogram(extra, HISTO_WIDTH, HISTO_HEIGHT); hashg = tally_histogram(hash, HISTO_WIDTH, HISTO_HEIGHT); uncoalg = tally_histogram(uncoal, HISTO_WIDTH, HISTO_HEIGHT); - } else { - freeg = keysg = datag = deadg = extrag = hashg = NULL; } /* 20 is max length of a %zu. */