summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-04-18 09:21:41 -0700
committerPatrick Venture <venture@google.com>2018-04-24 19:56:22 +0000
commit50cf1c57b782cfb139245b15893f59d19066ee4f (patch)
tree30fb0005f3f8cdae461bc7c370ee04a719014d79
parent979c806dc6d236711a5eb7752d61b8895036192d (diff)
downloadphosphor-hwmon-50cf1c57b782cfb139245b15893f59d19066ee4f.tar.gz
phosphor-hwmon-50cf1c57b782cfb139245b15893f59d19066ee4f.zip
mainloop cleanup: added std namespace where missing
A few calls into libc weren't wrapped with the standard namespace. This will ensure they are the calls intended via the wrapped cpp libraries. Change-Id: I966b5d2133efe6c0ac56701a2a60eef6d6d7f6e0 Signed-off-by: Patrick Venture <venture@google.com>
-rw-r--r--mainloop.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/mainloop.cpp b/mainloop.cpp
index 9a48755..4c74f53 100644
--- a/mainloop.cpp
+++ b/mainloop.cpp
@@ -17,6 +17,7 @@
#include <iostream>
#include <memory>
#include <cstdlib>
+#include <cstring>
#include <string>
#include <unordered_set>
@@ -86,7 +87,7 @@ void addRemoveRCs(const SensorSet::key_type& sensor,
// Convert to a char* for strtok
std::vector<char> rmRCs(rcList.c_str(),
rcList.c_str() + rcList.size() + 1);
- auto rmRC = strtok(&rmRCs[0], ", ");
+ auto rmRC = std::strtok(&rmRCs[0], ", ");
while (rmRC != nullptr)
{
try
@@ -102,7 +103,7 @@ void addRemoveRCs(const SensorSet::key_type& sensor,
entry("RC=%s", rmRC),
entry("EXCEPTION=%s", le.what()));
}
- rmRC = strtok(nullptr, ", ");
+ rmRC = std::strtok(nullptr, ", ");
}
}
@@ -474,7 +475,7 @@ void MainLoop::init()
auto interval = env::getEnv("INTERVAL");
if (!interval.empty())
{
- _interval = strtoull(interval.c_str(), NULL, 10);
+ _interval = std::strtoull(interval.c_str(), NULL, 10);
}
}
}
OpenPOWER on IntegriCloud