Skip to content

Commit

Permalink
fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
joske committed Aug 25, 2023
1 parent 4d8aa6b commit d17e1a2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/osx/smc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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");
}
Expand Down

0 comments on commit d17e1a2

Please sign in to comment.