From fa6e50d6c79633e22ad4cfc75f56aaa40112ecbb Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Tue, 3 Oct 2023 16:26:30 +0200 Subject: [PATCH] fuzz: Use C++20 starts_with in rpc.cpp --- src/test/fuzz/rpc.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/test/fuzz/rpc.cpp b/src/test/fuzz/rpc.cpp index 2189dc00671b6..2325bf094139f 100644 --- a/src/test/fuzz/rpc.cpp +++ b/src/test/fuzz/rpc.cpp @@ -380,9 +380,7 @@ FUZZ_TARGET(rpc, .init = initialize_rpc) rpc_testing_setup->CallRPC(rpc_command, arguments); } catch (const UniValue& json_rpc_error) { const std::string error_msg{json_rpc_error.find_value("message").get_str()}; - // Once c++20 is allowed, starts_with can be used. - // if (error_msg.starts_with("Internal bug detected")) { - if (0 == error_msg.rfind("Internal bug detected", 0)) { + if (error_msg.starts_with("Internal bug detected")) { // Only allow the intentional internal bug assert(error_msg.find("trigger_internal_bug") != std::string::npos); }