Commit fa77f95 MarcoFalke
committed
1 parent 577bd51 commit fa77f95 Copy full SHA for fa77f95
File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -360,7 +360,9 @@ FUZZ_TARGET_INIT(rpc, initialize_rpc)
360
360
rpc_testing_setup->CallRPC (rpc_command, arguments);
361
361
} catch (const UniValue& json_rpc_error) {
362
362
const std::string error_msg{find_value (json_rpc_error, " message" ).get_str ()};
363
- if (error_msg.find (" Internal bug detected" ) != std::string::npos) {
363
+ // Once c++20 is allowed, starts_with can be used.
364
+ // if (error_msg.starts_with("Internal bug detected")) {
365
+ if (0 == error_msg.rfind (" Internal bug detected" , 0 )) {
364
366
// Only allow the intentional internal bug
365
367
assert (error_msg.find (" trigger_internal_bug" ) != std::string::npos);
366
368
}
Original file line number Diff line number Diff line change @@ -33,11 +33,11 @@ class NonFatalCheckError : public std::runtime_error
33
33
do { \
34
34
if (!(condition)) { \
35
35
throw NonFatalCheckError ( \
36
- strprintf (" %s:%d (%s) \n " \
37
- " Internal bug detected: '%s' \n " \
36
+ strprintf (" Internal bug detected: '%s' \n " \
37
+ " %s:%d (%s) \n " \
38
38
" You may report this issue here: %s\n " , \
39
- __FILE__, __LINE__, __func__, \
40
39
(#condition), \
40
+ __FILE__, __LINE__, __func__, \
41
41
PACKAGE_BUGREPORT)); \
42
42
} \
43
43
} while (false )
You can’t perform that action at this time.
0 commit comments