From: Vedansh Bhartia Date: Sun, 16 Jul 2023 04:58:07 +0000 (+0530) Subject: rgw: typecast long long to int when passing length to format string X-Git-Tag: v19.0.0~783^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=51e076cecb45f240063099bd026b30e36008452b;p=ceph.git rgw: typecast long long to int when passing length to format string Signed-off-by: Vedansh Bhartia --- diff --git a/src/rgw/rgw_formats.cc b/src/rgw/rgw_formats.cc index 3affb5f141425..576c08d9aff73 100644 --- a/src/rgw/rgw_formats.cc +++ b/src/rgw/rgw_formats.cc @@ -167,10 +167,11 @@ void RGWFormatter_Plain::dump_format_va(std::string_view name, const char *ns, b eol = ""; wrote_something = true; - if (use_kv && !entry.is_array) - write_data("%s%.*s: %s", eol, name.size(), name.data(), buf); - else + if (use_kv && !entry.is_array) { + write_data("%s%.*s: %s", eol, static_cast(name.size()), name.data(), buf); + } else { write_data("%s%s", eol, buf); + } } int RGWFormatter_Plain::get_len() const @@ -277,10 +278,11 @@ void RGWFormatter_Plain::dump_value_int(std::string_view name, const char *fmt, eol = ""; wrote_something = true; - if (use_kv && !entry.is_array) - write_data("%s%.*s: %s", eol, name.size(), name.data(), buf); - else + if (use_kv && !entry.is_array) { + write_data("%s%.*s: %s", eol, static_cast(name.size()), name.data(), buf); + } else { write_data("%s%s", eol, buf); + } }