From 97ca95a8a22c21e8cf31416579fa792488359819 Mon Sep 17 00:00:00 2001 From: Leon Buckel Date: Tue, 20 Dec 2022 14:53:06 +0100 Subject: [PATCH] Don't use appStaticString1024. It's broken... --- Core/Inc/FConfigCacheIni.h | 7 ++++++- Core/Inc/UnFile.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Core/Inc/FConfigCacheIni.h b/Core/Inc/FConfigCacheIni.h index 0edf7efe..bd5ea65e 100644 --- a/Core/Inc/FConfigCacheIni.h +++ b/Core/Inc/FConfigCacheIni.h @@ -339,7 +339,12 @@ class FConfigCacheIni : public FConfigCache, public TMap{ const TCHAR* GetStr(const TCHAR* Section, const TCHAR* Key, const TCHAR* Filename){ guard(FConfigCacheIni::GetStr); - TCHAR* Result = appStaticString1024(); + // appStaticString1024 is broken and shouldn't be used + //TCHAR* Result = appStaticString1024(); + static INT Idx = 0; + static TCHAR Buffer[4][1024]; + + TCHAR* Result = Buffer[Idx++ & 3]; if(GetString(Section, Key, Result, 1024, Filename)) return Result; diff --git a/Core/Inc/UnFile.h b/Core/Inc/UnFile.h index 0167778c..725dcb2c 100644 --- a/Core/Inc/UnFile.h +++ b/Core/Inc/UnFile.h @@ -317,7 +317,7 @@ CORE_API TCHAR* appStrcat(TCHAR* Dest, const TCHAR* Src); CORE_API INT appStrcmp(const TCHAR* String1, const TCHAR* String2); CORE_API INT appStricmp(const TCHAR* String1, const TCHAR* String2); CORE_API INT appStrncmp(const TCHAR* String1, const TCHAR* String2, INT Count); -CORE_API TCHAR* appStaticString1024(); +//CORE_API TCHAR* appStaticString1024(); // Broken, don't use! CORE_API const TCHAR* appSpc(int Num); CORE_API TCHAR* appStrncpy(TCHAR* Dest, const TCHAR* Src, int Max);