From d436f1cdecc03ea15a777386a14f416f3c2811b3 Mon Sep 17 00:00:00 2001 From: bitscher Date: Sun, 28 Aug 2022 23:28:25 -0700 Subject: [PATCH] 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) ^~~~~~ ~~~~~~~ --- src/Cafe/IOSU/legacy/iosu_crypto.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Cafe/IOSU/legacy/iosu_crypto.cpp b/src/Cafe/IOSU/legacy/iosu_crypto.cpp index cf704155..0433995c 100644 --- a/src/Cafe/IOSU/legacy/iosu_crypto.cpp +++ b/src/Cafe/IOSU/legacy/iosu_crypto.cpp @@ -53,7 +53,7 @@ bool iosuCrypto_getDeviceId(uint32* deviceId) { uint32be deviceIdBE; *deviceId = 0; - if (otpMem == nullptr) + if (!hasOtpMem) return false; iosuCrypto_readOtpData(&deviceIdBE, 0x87, sizeof(uint32)); *deviceId = (uint32)deviceIdBE; @@ -227,7 +227,7 @@ void iosuCrypto_generateDeviceCertificate() { static_assert(sizeof(g_wiiuDeviceCert) == 0x180); memset(&g_wiiuDeviceCert, 0, sizeof(g_wiiuDeviceCert)); - if (otpMem == nullptr) + if (!hasOtpMem) return; // cant generate certificate without OPT // set header based on otp security mode