From 94708aebd31eca86d48523a37fc77485aace2ef6 Mon Sep 17 00:00:00 2001 From: Kenzzer Date: Sun, 12 May 2024 16:33:22 +0200 Subject: [PATCH] avoid infinite logging loops --- core/metamod.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/metamod.cpp b/core/metamod.cpp index f0f6b7c..827ad47 100644 --- a/core/metamod.cpp +++ b/core/metamod.cpp @@ -415,6 +415,11 @@ FileSystemFactory(const char *iface, int *ret) void mm_LogMessage(const char *msg, ...) { + static bool g_logging = false; + if (g_logging) { + return; + } + g_logging = true; va_list ap; static char buffer[2048]; @@ -431,6 +436,7 @@ mm_LogMessage(const char *msg, ...) fprintf(stdout, "%s", buffer); } provider->ConsolePrint(buffer); + g_logging = false; } static void