]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/cephfs: use snprintf in Dumper 6616/head 6617/head
authorJohn Spray <john.spray@redhat.com>
Tue, 17 Nov 2015 12:18:03 +0000 (12:18 +0000)
committerJohn Spray <john.spray@redhat.com>
Tue, 17 Nov 2015 12:20:31 +0000 (12:20 +0000)
Signed-off-by: John Spray <john.spray@redhat.com>
src/tools/cephfs/Dumper.cc

index bade9754edc9b4aa53145aa8a87593c192158454..f97029e4341d4e8f925fd5f6cf5ee057bfca1106 100644 (file)
@@ -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,