Skip to content

Commit

Permalink
Fix potential undefined behavior in params initialization for C++14 c…
Browse files Browse the repository at this point in the history
…ompliance
  • Loading branch information
flightlessmango committed Nov 15, 2024
1 parent 4ab106f commit 744c188
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/overlay_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -777,9 +777,9 @@ parse_overlay_config(struct overlay_params *params,
{
SPDLOG_DEBUG("Version: {}", MANGOHUD_VERSION);
std::vector<int> default_preset = {-1, 0, 1, 2, 3, 4};
*params = {
.preset = use_existing_preset ? params->preset : default_preset
};
auto preset = std::move(params->preset);
*params = {};
params->preset = use_existing_preset ? std::move(preset) : default_preset;
set_param_defaults(params);
if (!use_existing_preset) {
current_preset = params->preset[0];
Expand Down

0 comments on commit 744c188

Please sign in to comment.