From 87f7ca0bb4592c3d100a6343c38d30f49669cab9 Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Sun, 16 Aug 2015 21:05:47 +0200 Subject: [PATCH] cfg: Allow LoadInt to parse hex strings --- core/cfg/cfg.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/cfg/cfg.cpp b/core/cfg/cfg.cpp index 4c7ee30d1..3822fb5aa 100644 --- a/core/cfg/cfg.cpp +++ b/core/cfg/cfg.cpp @@ -320,7 +320,14 @@ s32 ConfigFile::LoadInt(const wchar * Section, const wchar * Key,s32 Default) wchar temp_o[30]; sprintf(temp_d,"%d",Default); this->LoadStr(Section,Key,temp_o,temp_d); - return atoi(temp_o); + if (strstr(temp_o, "0x") != NULL) + { + return strtol(temp_o, NULL, 16); + } + else + { + return atoi(temp_o); + } } ConfigFile cfgdb;