From 3275bbf01b79eefb77861cca1fa4fd79c6ae1403 Mon Sep 17 00:00:00 2001 From: worktycho Date: Sat, 7 Jun 2014 00:10:58 +0100 Subject: [PATCH] Fix reading 64 bit values --- lib/inifile/iniFile.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/inifile/iniFile.cpp b/lib/inifile/iniFile.cpp index 7515483df..0c208b953 100644 --- a/lib/inifile/iniFile.cpp +++ b/lib/inifile/iniFile.cpp @@ -449,7 +449,7 @@ bool cIniFile::SetValueI(const AString & a_KeyName, const AString & a_ValueName, bool cIniFile::SetValueI(const AString & a_Keyname, const AString & a_ValueName, const Int64 a_Value, const bool a_CreateIfNotExists) { - return SetValue(a_Keyname, a_ValueName, Printf("lld", a_Value), a_CreateIfNotExists); + return SetValue(a_Keyname, a_ValueName, Printf("%lld", a_Value), a_CreateIfNotExists); } @@ -584,7 +584,10 @@ Int64 cIniFile::GetValueSetI(const AString & keyname, const AString & valuename, { AString Data; Printf(Data, "%lld", defValue); - return std::stoll(GetValueSet(keyname, valuename, Data)); + Astring resultstring = GetValueSet(keyname, valuename, Data); + Int64 result; + sscanf(resultstring.c_str(), "%lld", &result); + return result; }