Address review comments

This commit is contained in:
FearlessTobi 2019-11-03 07:04:28 +01:00
parent ac3690f205
commit 0fe11746fc
4 changed files with 72 additions and 65 deletions

View file

@ -9,7 +9,7 @@
namespace InputCommon::CemuhookUDP {
static const std::size_t GetSizeOfResponseType(Type t) {
static constexpr std::size_t GetSizeOfResponseType(Type t) {
switch (t) {
case Type::Version:
return sizeof(Response::Version);
@ -34,7 +34,7 @@ std::optional<Type> Validate(u8* data, std::size_t size) {
LOG_DEBUG(Input, "Invalid UDP packet received");
return {};
}
Header header;
Header header{};
std::memcpy(&header, data, sizeof(Header));
if (header.magic != SERVER_MAGIC) {
LOG_ERROR(Input, "UDP Packet has an unexpected magic value");