You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// in ScriptExtender.cpp
std::string ScriptExtender::iniConfigFolder;
iniConfigFolder = IniReader::GetConfigString("Scripts", "IniConfigFolder", "", 64);
size_t len = iniConfigFolder.length();
dlog_f("IniConfigFolder: %s, len: %d\n", DL_MAIN, iniConfigFolder.c_str(), len); // for testing
With IniConfigFolder=mods\thisismysuperawesomemod\withlotsofqolfeatures\youshouldreallycheckit in ddraw.ini, before the result string was truncated as it should be:
For GetString() variant returning size_t value, I think the mismatch can be fixed by return strlen(buf); instead of return value->size();. For the variant returning std:string, I can only think of this:
Taking
IniConfigFolder
option for example:With
IniConfigFolder=mods\thisismysuperawesomemod\withlotsofqolfeatures\youshouldreallycheckit
in ddraw.ini, before the result string was truncated as it should be:But now with new INI parser it doesn't get truncated at all:
If changing ScriptExtender::iniConfigFolder to a char array:
The result string is truncated correctly, but the returned size_t value is still "full length":
For
GetString()
variant returning size_t value, I think the mismatch can be fixed byreturn strlen(buf);
instead ofreturn value->size();
. For the variant returning std:string, I can only think of this:The text was updated successfully, but these errors were encountered: