diff --git a/Controllers/MSIMotherboardController/MSIMotherboard185Controller/MSIMotherboard185Controller.cpp b/Controllers/MSIMotherboardController/MSIMotherboard185Controller/MSIMotherboard185Controller.cpp index 08e911e6b..5a70458c9 100644 --- a/Controllers/MSIMotherboardController/MSIMotherboard185Controller/MSIMotherboard185Controller.cpp +++ b/Controllers/MSIMotherboardController/MSIMotherboard185Controller/MSIMotherboard185Controller.cpp @@ -868,10 +868,16 @@ bool MSIMotherboard185Controller::Update } else { + /*-------------------------------------------------*\ + | Set the save flag | + \*-------------------------------------------------*/ + configuration_data.save_data = save; + /*-------------------------------------------------*\ | Save a copy of the new configuration data | \*-------------------------------------------------*/ - FeaturePacket_185 new_configuration = configuration_data; + FeaturePacket_185 new_configuration; + memcpy((unsigned char*)&new_configuration, (unsigned char*)&configuration_data, sizeof(configuration_data)); /*-------------------------------------------------*\ @@ -879,11 +885,6 @@ bool MSIMotherboard185Controller::Update \*-------------------------------------------------*/ ReadConfigurationData(); - /*-------------------------------------------------*\ - | Set the save flag on the old data | - \*-------------------------------------------------*/ - configuration_data.save_data = save; - /*-------------------------------------------------*\ | First, send a copy of the existing configuration | | data | @@ -896,12 +897,7 @@ bool MSIMotherboard185Controller::Update | Windows sends the old data followed by new data | | so this mimics that flow. | \*-------------------------------------------------*/ - memcpy((unsigned char*)&new_configuration, (unsigned char*)&new_configuration, sizeof(new_configuration)); - - /*-------------------------------------------------*\ - | Set the save flag on the new data | - \*-------------------------------------------------*/ - configuration_data.save_data = save; + memcpy((unsigned char*)&configuration_data, (unsigned char*)&new_configuration, sizeof(new_configuration)); return(hid_send_feature_report(dev, (unsigned char*)&configuration_data, sizeof(configuration_data)) == sizeof(configuration_data)); }