1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

fix config parsing bug

This commit is contained in:
IntelOrca
2015-05-21 02:52:32 +01:00
parent 22212df32a
commit bdd712bc4b
2 changed files with 8 additions and 4 deletions

Binary file not shown.

View File

@@ -475,9 +475,11 @@ config_section_definition *config_get_section_def(const utf8 *name, int size)
{
int i;
for (i = 0; i < countof(_sectionDefinitions); i++)
if (_strnicmp(_sectionDefinitions[i].section_name, name, size) == 0)
for (i = 0; i < countof(_sectionDefinitions); i++) {
const_utf8string sectionName = _sectionDefinitions[i].section_name;
if (sectionName[size] == 0 && _strnicmp(sectionName, name, size) == 0)
return &_sectionDefinitions[i];
}
return NULL;
}
@@ -486,9 +488,11 @@ config_property_definition *config_get_property_def(config_section_definition *s
{
int i;
for (i = 0; i < section->property_definitions_count; i++)
if (_strnicmp(section->property_definitions[i].property_name, name, size) == 0)
for (i = 0; i < section->property_definitions_count; i++) {
const_utf8string propertyName = section->property_definitions[i].property_name;
if (propertyName[size] == 0 && _strnicmp(propertyName, name, size) == 0)
return &section->property_definitions[i];
}
return NULL;
}