Fix: do not use lengthof() for non C-style arrays
(cherry picked from commit c544a2be0a
)
This commit is contained in:

committed by
Jonathan G Rennison

parent
c5b854a422
commit
919830db7a
@@ -2484,7 +2484,7 @@ static void GraphicsSetLoadConfig(IniFile &ini)
|
||||
|
||||
if (const IniItem *item = group->GetItem("extra_params"); item != nullptr && item->value) {
|
||||
auto &extra_params = BaseGraphics::ini_data.extra_params;
|
||||
extra_params.resize(lengthof(GRFConfig::param));
|
||||
extra_params.resize(0x80); // TODO: make ParseIntList work nicely with C++ containers
|
||||
int count = ParseIntList(item->value->c_str(), &extra_params.front(), extra_params.size());
|
||||
if (count < 0) {
|
||||
SetDParamStr(0, BaseGraphics::ini_data.name);
|
||||
|
Reference in New Issue
Block a user