From c4e7fa33750c4dd319d6e8402f058f40c9e9d0d9 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Mon, 1 Aug 2022 00:11:11 +0200 Subject: [PATCH] Util: Improve check on formatting recursion for asserts --- src/util/meta/assert.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/meta/assert.h b/src/util/meta/assert.h index c6e58ec..d5ca3a5 100644 --- a/src/util/meta/assert.h +++ b/src/util/meta/assert.h @@ -66,8 +66,8 @@ inline void __assertion_failed(const char* assertion, const char* file, uint32_t fprintf(stderr, ": "); // Cant use the formatting library to print asserts caused by the formatting library std::string_view functionString = function; - if (!functionString.starts_with("Util::Format::") - && !functionString.starts_with("Util::GenericLexer::")) { + if (functionString.find("Util::Format::") != std::string_view::npos + && functionString.find("Util::GenericLexer::") != std::string_view::npos) { std::string message; formatTo(message, parameters...); fprintf(stderr, "%s", message.c_str());