diff --git a/test/fuzzing/named_arg.cpp b/test/fuzzing/named_arg.cpp index 247f9495d418..ddd90d1c472b 100644 --- a/test/fuzzing/named_arg.cpp +++ b/test/fuzzing/named_arg.cpp @@ -33,7 +33,7 @@ void invoke_fmt(const uint8_t* Data, std::size_t Size, unsigned int argsize) { std::memcpy(argnamebuffer.data(), Data, argsize); auto argname = fmt::string_view(argnamebuffer.data(), argsize); #else - auto argname = fmt::string_view((const char*)Data, argsize); + auto argname = fmt::string_view(fmt_fuzzer::as_chars(Data), argsize); #endif Data += argsize; Size -= argsize; @@ -44,7 +44,7 @@ void invoke_fmt(const uint8_t* Data, std::size_t Size, unsigned int argsize) { std::memcpy(fmtstringbuffer.data(), Data, Size); auto fmtstring = fmt::string_view(fmtstringbuffer.data(), Size); #else - auto fmtstring = fmt::string_view((const char*)Data, Size); + auto fmtstring = fmt::string_view(fmt_fuzzer::as_chars(Data), Size); #endif std::string message = fmt::format(fmtstring, fmt::arg(argname, item1)); } diff --git a/test/fuzzing/one_arg.cpp b/test/fuzzing/one_arg.cpp index b45f25123305..70b06b9b59b5 100644 --- a/test/fuzzing/one_arg.cpp +++ b/test/fuzzing/one_arg.cpp @@ -29,7 +29,7 @@ void invoke_fmt(const uint8_t* Data, std::size_t Size) { std::memcpy(fmtstringbuffer.data(), Data, Size); auto fmtstring = fmt::string_view(fmtstringbuffer.data(), Size); #else - auto fmtstring = fmt::string_view((const char*)Data, Size); + auto fmtstring = fmt::string_view(fmt_fuzzer::as_chars(Data), Size); #endif #if FMT_FUZZ_FORMAT_TO_STRING @@ -56,7 +56,7 @@ void invoke_fmt_time(const uint8_t* Data, std::size_t Size) { std::memcpy(fmtstringbuffer.data(), Data, Size); auto fmtstring = fmt::string_view(fmtstringbuffer.data(), Size); #else - auto fmtstring = fmt::string_view((const char*)Data, Size); + auto fmtstring = fmt::string_view(fmt_fuzzer::as_chars(Data), Size); #endif auto* b = std::localtime(&item); if (b) {