Skip to content

Commit 7326198

Browse files
committed
Show input data as string on failure
1 parent 3ce3179 commit 7326198

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fuzzing/fuzz_scientific_to_int.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t* data, std::size_t size)
1515
{
16+
const boost::core::string_view sv{reinterpret_cast<const char*>(data), size};
1617
using boost::locale::util::try_scientific_to_int;
1718
try {
18-
const boost::core::string_view sv{reinterpret_cast<const char*>(data), size};
1919

2020
uint8_t u8{};
2121
try_scientific_to_int(sv, u8);
@@ -29,7 +29,7 @@ extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t* data, std::size_t size
2929
uint8_t u64{};
3030
try_scientific_to_int(sv, u64);
3131
} catch(...) {
32-
std::cerr << "Error with '" << data << "' (size " << size << ')' << std::endl;
32+
std::cerr << "Error with '" << sv << "' (size " << size << ')' << std::endl;
3333
std::terminate();
3434
}
3535

0 commit comments

Comments
 (0)