Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
pauldreik committed Jun 28, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
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
@@ -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

0 comments on commit f404079

Please sign in to comment.