From: John Spray Date: Tue, 17 Nov 2015 12:18:03 +0000 (+0000) Subject: tools/cephfs: use snprintf in Dumper X-Git-Tag: v10.0.1~32^2~2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F6617%2Fhead;p=ceph.git tools/cephfs: use snprintf in Dumper Signed-off-by: John Spray --- diff --git a/src/tools/cephfs/Dumper.cc b/src/tools/cephfs/Dumper.cc index bade9754edc9..f97029e4341d 100644 --- a/src/tools/cephfs/Dumper.cc +++ b/src/tools/cephfs/Dumper.cc @@ -93,7 +93,7 @@ int Dumper::dump(const char *dump_file) // include an informative header char buf[HEADER_LEN]; memset(buf, 0, sizeof(buf)); - sprintf(buf, "Ceph mds%d journal dump\n start offset %llu (0x%llx)\n length %llu (0x%llx)\n write_pos %llu (0x%llx)\n format %llu\n trimmed_pos %llu (0x%llx)\n%c", + snprintf(buf, HEADER_LEN, "Ceph mds%d journal dump\n start offset %llu (0x%llx)\n length %llu (0x%llx)\n write_pos %llu (0x%llx)\n format %llu\n trimmed_pos %llu (0x%llx)\n%c", rank, (unsigned long long)start, (unsigned long long)start, (unsigned long long)len, (unsigned long long)len,