From 58753453a7a5e3d5fcf301e585107ee1c10c261e Mon Sep 17 00:00:00 2001 From: John Spray Date: Tue, 17 Nov 2015 12:18:03 +0000 Subject: [PATCH] tools/cephfs: use snprintf in Dumper Signed-off-by: John Spray --- src/tools/cephfs/Dumper.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/cephfs/Dumper.cc b/src/tools/cephfs/Dumper.cc index bade9754edc9b..f97029e4341d4 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, -- 2.39.5