1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

Avoid VLA usage and prohibit it by compiler flag

This commit is contained in:
sfan5 2024-10-27 20:41:25 +01:00
parent 721e06451e
commit 38f4d11d53
4 changed files with 6 additions and 7 deletions

View file

@ -291,13 +291,13 @@ bool GUIModalMenu::preprocessEvent(const SEvent &event)
s32 selected_idx = dropdown->getSelected();
s32 option_size = dropdown->getItemCount();
std::string list_of_options[option_size];
std::vector<std::string> list_of_options;
for (s32 i = 0; i < option_size; i++) {
list_of_options[i] = wide_to_utf8(dropdown->getItem(i));
list_of_options.push_back(wide_to_utf8(dropdown->getItem(i)));
}
porting::showComboBoxDialog(list_of_options, option_size, selected_idx);
porting::showComboBoxDialog(list_of_options.data(), option_size, selected_idx);
return true; // Prevent the Irrlicht dropdown from opening.
}
}