Skip to content

Commit fa6e50d

Browse files
author
MarcoFalke
committed
fuzz: Use C++20 starts_with in rpc.cpp
1 parent faa4838 commit fa6e50d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/test/fuzz/rpc.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,7 @@ FUZZ_TARGET(rpc, .init = initialize_rpc)
380380
rpc_testing_setup->CallRPC(rpc_command, arguments);
381381
} catch (const UniValue& json_rpc_error) {
382382
const std::string error_msg{json_rpc_error.find_value("message").get_str()};
383-
// Once c++20 is allowed, starts_with can be used.
384-
// if (error_msg.starts_with("Internal bug detected")) {
385-
if (0 == error_msg.rfind("Internal bug detected", 0)) {
383+
if (error_msg.starts_with("Internal bug detected")) {
386384
// Only allow the intentional internal bug
387385
assert(error_msg.find("trigger_internal_bug") != std::string::npos);
388386
}

0 commit comments

Comments
 (0)