diff options
author | Jos Dehaes <jos.dehaes@gmail.com> | 2023-08-25 16:18:39 +0200 |
---|---|---|
committer | Jos Dehaes <jos.dehaes@gmail.com> | 2023-08-25 16:18:39 +0200 |
commit | d17e1a2dac79458940319d7117a21bdcd73ed53c (patch) | |
tree | e5841cfd97025fcb92a6b4a0f3247fd8845fdeaa /src/osx | |
parent | 4d8aa6b11896dac99f81019e6dea11cc8d8856f1 (diff) |
fix some warnings
Diffstat (limited to 'src/osx')
-rw-r--r-- | src/osx/smc.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/osx/smc.cpp b/src/osx/smc.cpp index 36ac4d9..6c483db 100644 --- a/src/osx/smc.cpp +++ b/src/osx/smc.cpp @@ -37,7 +37,7 @@ static UInt32 _strtoul(char *str, int size, int base) { static void _ultostr(char *str, UInt32 val) { str[0] = '\0'; - sprintf(str, "%c%c%c%c", + snprintf(str, 5, "%c%c%c%c", (unsigned int)val >> 24, (unsigned int)val >> 16, (unsigned int)val >> 8, @@ -47,10 +47,8 @@ static void _ultostr(char *str, UInt32 val) { namespace Cpu { SMCConnection::SMCConnection() { - IOMasterPort(kIOMasterPortDefault, &masterPort); - CFMutableDictionaryRef matchingDictionary = IOServiceMatching("AppleSMC"); - result = IOServiceGetMatchingServices(masterPort, matchingDictionary, &iterator); + result = IOServiceGetMatchingServices(0, matchingDictionary, &iterator); if (result != kIOReturnSuccess) { throw std::runtime_error("failed to get AppleSMC"); } |