Util: Improve check on formatting recursion for asserts

This commit is contained in:
Riyyi
2022-08-01 00:11:11 +02:00
parent b574a79dfe
commit c4e7fa3375
+2 -2
View File
@@ -66,8 +66,8 @@ inline void __assertion_failed(const char* assertion, const char* file, uint32_t
fprintf(stderr, ": "); fprintf(stderr, ": ");
// Cant use the formatting library to print asserts caused by the formatting library // Cant use the formatting library to print asserts caused by the formatting library
std::string_view functionString = function; std::string_view functionString = function;
if (!functionString.starts_with("Util::Format::") if (functionString.find("Util::Format::") != std::string_view::npos
&& !functionString.starts_with("Util::GenericLexer::")) { && functionString.find("Util::GenericLexer::") != std::string_view::npos) {
std::string message; std::string message;
formatTo(message, parameters...); formatTo(message, parameters...);
fprintf(stderr, "%s", message.c_str()); fprintf(stderr, "%s", message.c_str());