Fix fuzzer

This commit is contained in:
Victor Zverovich
2025-11-02 07:26:47 -10:00
parent b6cd356196
commit 33ad559eb8

View File

@@ -12,10 +12,10 @@ void invoke_inner(fmt::string_view format_str, Rep rep) {
auto value = std::chrono::duration<Rep, Period>(rep); auto value = std::chrono::duration<Rep, Period>(rep);
try { try {
#if FMT_FUZZ_FORMAT_TO_STRING #if FMT_FUZZ_FORMAT_TO_STRING
std::string message = fmt::format(format_str, value); std::string message = fmt::format(fmt::runtime(format_str), value);
#else #else
auto buf = fmt::memory_buffer(); auto buf = fmt::memory_buffer();
fmt::format_to(std::back_inserter(buf), format_str, value); fmt::format_to(std::back_inserter(buf), fmt::runtime(format_str), value);
#endif #endif
} catch (std::exception&) { } catch (std::exception&) {
} }