Skip to content

Commit

Permalink
make named_arg write into a string or a memory_buffer
Browse files Browse the repository at this point in the history
this makes the fuzzer consistent with the others.
  • Loading branch information
pauldreik committed Jun 28, 2019
1 parent 545dbe1 commit f404079
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/fuzzing/named_arg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ void invoke_fmt(const uint8_t* Data, std::size_t Size, unsigned int argsize) {
#else
auto fmtstring = fmt::string_view(fmt_fuzzer::as_chars(Data), Size);
#endif

#if FMT_FUZZ_FORMAT_TO_STRING
std::string message = fmt::format(fmtstring, fmt::arg(argname, item1));
#else
fmt::memory_buffer outbuf;
fmt::format_to(outbuf, fmtstring, fmt::arg(argname, item1));
#endif
}

// for dynamic dispatching to an explicit instantiation
Expand Down

0 comments on commit f404079

Please sign in to comment.