fix core check

This commit is contained in:
Jos Dehaes 2023-08-25 15:52:58 +02:00
parent dcbdb7360d
commit 4d8aa6b118
1 changed files with 3 additions and 3 deletions

View File

@ -94,10 +94,10 @@ namespace Cpu {
// according to VirtualSMC docs (hackintosh fake SMC) the enumeration follows with alphabetic chars - not implemented yet here (nor in VirtualSMC) // according to VirtualSMC docs (hackintosh fake SMC) the enumeration follows with alphabetic chars - not implemented yet here (nor in VirtualSMC)
long long SMCConnection::getTemp(int core) { long long SMCConnection::getTemp(int core) {
char key[] = SMC_KEY_CPU_TEMP; char key[] = SMC_KEY_CPU_TEMP;
if (core > MaxIndexCount) { if (core >= 0) {
if ((size_t)core > MaxIndexCount) {
return -1; return -1;
} }
if (core >= 0) {
snprintf(key, 5, "TC%1cc", KeyIndexes[core]); snprintf(key, 5, "TC%1cc", KeyIndexes[core]);
} }
long long result = getSMCTemp(key); long long result = getSMCTemp(key);