diff options
author | Volker Lendecke <vl@samba.org> | 2011-03-30 06:51:40 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2011-03-30 09:58:32 +0200 |
commit | 0080f944b47f3afa676153e5da7093a8667fc005 (patch) | |
tree | d96e64145b9c28f7f56428fc327d0402bbdec63c | |
parent | 014d4093c3bdf0481a415b2df3084b743a9b4845 (diff) | |
download | samba-0080f944b47f3afa676153e5da7093a8667fc005.tar.gz samba-0080f944b47f3afa676153e5da7093a8667fc005.tar.bz2 samba-0080f944b47f3afa676153e5da7093a8667fc005.zip |
tdb: Fix Coverity ID 2238: SECURE_CODING
-rw-r--r-- | lib/tdb/common/summary.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/lib/tdb/common/summary.c b/lib/tdb/common/summary.c index da1ec2b739..b222a5993d 100644 --- a/lib/tdb/common/summary.c +++ b/lib/tdb/common/summary.c @@ -159,30 +159,30 @@ _PUBLIC_ char *tdb_summary(struct tdb_context *tdb) if (!ret) goto unlock; - sprintf(ret, SUMMARY_FORMAT, - tdb->map_size, keys.total+data.total, - keys.num, - keys.min, tally_mean(&keys), keys.max, - data.min, tally_mean(&data), data.max, - extra.min, tally_mean(&extra), extra.max, - dead.num, - dead.min, tally_mean(&dead), dead.max, - freet.num, - freet.min, tally_mean(&freet), freet.max, - hash.num, - hash.min, tally_mean(&hash), hash.max, - uncoal.total, - uncoal.min, tally_mean(&uncoal), uncoal.max, - keys.total * 100.0 / tdb->map_size, - data.total * 100.0 / tdb->map_size, - extra.total * 100.0 / tdb->map_size, - freet.total * 100.0 / tdb->map_size, - dead.total * 100.0 / tdb->map_size, - (keys.num + freet.num + dead.num) - * (sizeof(struct tdb_record) + sizeof(uint32_t)) - * 100.0 / tdb->map_size, - tdb->header.hash_size * sizeof(tdb_off_t) - * 100.0 / tdb->map_size); + snprintf(ret, len, SUMMARY_FORMAT, + tdb->map_size, keys.total+data.total, + keys.num, + keys.min, tally_mean(&keys), keys.max, + data.min, tally_mean(&data), data.max, + extra.min, tally_mean(&extra), extra.max, + dead.num, + dead.min, tally_mean(&dead), dead.max, + freet.num, + freet.min, tally_mean(&freet), freet.max, + hash.num, + hash.min, tally_mean(&hash), hash.max, + uncoal.total, + uncoal.min, tally_mean(&uncoal), uncoal.max, + keys.total * 100.0 / tdb->map_size, + data.total * 100.0 / tdb->map_size, + extra.total * 100.0 / tdb->map_size, + freet.total * 100.0 / tdb->map_size, + dead.total * 100.0 / tdb->map_size, + (keys.num + freet.num + dead.num) + * (sizeof(struct tdb_record) + sizeof(uint32_t)) + * 100.0 / tdb->map_size, + tdb->header.hash_size * sizeof(tdb_off_t) + * 100.0 / tdb->map_size); unlock: if (locked) { |