Use s.c_str() in log messages
Fixes issues with data passed to phosphor::logging::log(entry()).
This is part of a series of commits that resolves openbmc 2905.
Tested: static_assert only
Change-Id: I9fac771f54e4acbec97ce1360c106b6e3eb4fe9d
Signed-off-by: Joseph Reynolds <jrey@us.ibm.com>
diff --git a/sensordatahandler.cpp b/sensordatahandler.cpp
index 20006dc..2d4ac3a 100644
--- a/sensordatahandler.cpp
+++ b/sensordatahandler.cpp
@@ -44,8 +44,8 @@
if (mapperResponseMsg.is_method_error())
{
log<level::ERR>("Mapper GetSubTree failed",
- entry("PATH=%s", path),
- entry("INTERFACE=%s", interface));
+ entry("PATH=%s", path.c_str()),
+ entry("INTERFACE=%s", interface.c_str()));
elog<InternalFailure>();
}
@@ -54,8 +54,8 @@
if (mapperResponse.empty())
{
log<level::ERR>("Invalid mapper response",
- entry("PATH=%s", path),
- entry("INTERFACE=%s", interface));
+ entry("PATH=%s", path.c_str()),
+ entry("INTERFACE=%s", interface.c_str()));
elog<InternalFailure>();
}
@@ -69,8 +69,8 @@
if (iter == mapperResponse.end())
{
log<level::ERR>("Couldn't find D-Bus path",
- entry("PATH=%s", path),
- entry("INTERFACE=%s", interface));
+ entry("PATH=%s", path.c_str()),
+ entry("INTERFACE=%s", interface.c_str()));
elog<InternalFailure>();
}
return std::make_pair(iter->first, iter->second.begin()->first);