From 27d6ff36df48d443df351091106aefd214540ac6 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 8 Jul 2023 15:09:34 +0800 Subject: [PATCH] compound_compat: do not format an sstring with {:d} before this change, we format a sstring with "{:d}", fmtlib would throw `fmt::format_error` at runtime when formatting it. this is not expected. so, in this change, we just print the int8_t using `seastar::format()` in a single pass. and with the format specifier of `#02x` instead of adding the "0x" prefix manually. Fixes #14577 Signed-off-by: Kefu Chai Closes #14578 --- compound_compat.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compound_compat.hh b/compound_compat.hh index f51ebbeb71..2d82b94abc 100644 --- a/compound_compat.hh +++ b/compound_compat.hh @@ -568,7 +568,7 @@ public: auto marker = it->second; ++it; if (it != e && marker != composite::eoc::none) { - throw runtime_exception(format("non-zero component divider found ({:d}) mid", format("0x{:02x}", composite::eoc_type(marker) & 0xff))); + throw runtime_exception(format("non-zero component divider found ({:#02x}) mid", composite::eoc_type(marker) & 0xff)); } } return ret;