Fix erroneous check on otpMem in iosu_crypto

/root/cemu/src/Cafe/IOSU/legacy/iosu_crypto.cpp:56:6: warning: comparison of array 'otpMem' equal to a null pointer is always false [-Wtautological-pointer-compare]
        if (otpMem == nullptr)
            ^~~~~~    ~~~~~~~
/root/cemu/src/Cafe/IOSU/legacy/iosu_crypto.cpp:230:6: warning: comparison of array 'otpMem' equal to a null pointer is always false [-Wtautological-pointer-compare]
        if (otpMem == nullptr)
            ^~~~~~    ~~~~~~~
This commit is contained in:
bitscher 2022-08-28 23:28:25 -07:00
parent 0aae976c75
commit d436f1cdec

View file

@ -53,7 +53,7 @@ bool iosuCrypto_getDeviceId(uint32* deviceId)
{ {
uint32be deviceIdBE; uint32be deviceIdBE;
*deviceId = 0; *deviceId = 0;
if (otpMem == nullptr) if (!hasOtpMem)
return false; return false;
iosuCrypto_readOtpData(&deviceIdBE, 0x87, sizeof(uint32)); iosuCrypto_readOtpData(&deviceIdBE, 0x87, sizeof(uint32));
*deviceId = (uint32)deviceIdBE; *deviceId = (uint32)deviceIdBE;
@ -227,7 +227,7 @@ void iosuCrypto_generateDeviceCertificate()
{ {
static_assert(sizeof(g_wiiuDeviceCert) == 0x180); static_assert(sizeof(g_wiiuDeviceCert) == 0x180);
memset(&g_wiiuDeviceCert, 0, sizeof(g_wiiuDeviceCert)); memset(&g_wiiuDeviceCert, 0, sizeof(g_wiiuDeviceCert));
if (otpMem == nullptr) if (!hasOtpMem)
return; // cant generate certificate without OPT return; // cant generate certificate without OPT
// set header based on otp security mode // set header based on otp security mode