diff --git a/Source/Core/Common/SysConf.h b/Source/Core/Common/SysConf.h index 271e5a0df2..28af700b36 100644 --- a/Source/Core/Common/SysConf.h +++ b/Source/Core/Common/SysConf.h @@ -55,7 +55,9 @@ struct SSysConfEntry template T GetData() { - return *(T*)data.data(); + T extracted_data; + std::memcpy(&extracted_data, data.data(), sizeof(T)); + return extracted_data; } bool GetArrayData(u8* dest, u16 destSize) { @@ -169,7 +171,7 @@ public: return false; } - *(T*)index->data.data() = newValue; + std::memcpy(index->data.data(), &newValue, sizeof(T)); return true; }