]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: print size_t using %xz
authorKefu Chai <kchai@redhat.com>
Sat, 8 May 2021 12:51:19 +0000 (20:51 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 11 May 2021 01:31:51 +0000 (09:31 +0800)
we cannot assume that size_t is an alias of "long"

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/os/bluestore/Allocator.cc

index 75f3172ca55bc6d474265a87b0d8e49c10f3b7ca..342854541469e01994e5c5d06560c6b324329ef8 100644 (file)
@@ -81,8 +81,8 @@ public:
         f->open_object_section("free");
         char off_hex[30];
         char len_hex[30];
-        snprintf(off_hex, sizeof(off_hex) - 1, "0x%lx", off);
-        snprintf(len_hex, sizeof(len_hex) - 1, "0x%lx", len);
+        snprintf(off_hex, sizeof(off_hex) - 1, "0x%zx", off);
+        snprintf(len_hex, sizeof(len_hex) - 1, "0x%zx", len);
         f->dump_string("offset", off_hex);
         f->dump_string("length", len_hex);
         f->close_section();