From: Sung-hun Kim Date: Fri, 8 Mar 2024 05:25:38 +0000 (+0900) Subject: Fix a wrong type of a log argument X-Git-Tag: accepted/tizen/unified/20240311.170354~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b97eaaeb378cf6f254d73f62f14262a1e6d4cb73;p=platform%2Fcore%2Fsystem%2Fcrash-worker.git Fix a wrong type of a log argument Previously, the given argument is a string type but the required type of the argument is char *. So, call c_str() for converting it. This patch fixes coverity issues (cid: 1097977, 1099764). Change-Id: I0f6595e629088b1d08d679cf718836c65947557d Signed-off-by: Sung-hun Kim --- diff --git a/src/livedumper/core.hpp b/src/livedumper/core.hpp index 81b359ca..582ad30d 100644 --- a/src/livedumper/core.hpp +++ b/src/livedumper/core.hpp @@ -406,7 +406,7 @@ class Core { auto phdr = AUXVval(auxv_data, AT_PHDR); if (phdr == 0) { - logger.log_info("PHDR not found for %s", exe_path); + logger.log_info("PHDR not found for %s", exe_path.c_str()); return; } diff --git a/src/livedumper/livedumper.hpp b/src/livedumper/livedumper.hpp index 851194ba..abda9e36 100644 --- a/src/livedumper/livedumper.hpp +++ b/src/livedumper/livedumper.hpp @@ -100,7 +100,7 @@ class LiveDumper { for (const auto &pid : m_tpids) { if (ptrace(PTRACE_DETACH, pid, nullptr, nullptr) == -1) { logger.log_error("Detach from PID %d error: %s", - pid, std::system_category().default_error_condition(errno).message()); + pid, std::system_category().default_error_condition(errno).message().c_str()); } } }