Fix a wrong type of a log argument 26/307426/2
authorSung-hun Kim <sfoon.kim@samsung.com>
Fri, 8 Mar 2024 05:25:38 +0000 (14:25 +0900)
committerSung-hun Kim <sfoon.kim@samsung.com>
Fri, 8 Mar 2024 07:32:20 +0000 (16:32 +0900)
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 <sfoon.kim@samsung.com>
src/livedumper/core.hpp
src/livedumper/livedumper.hpp

index 81b359c..582ad30 100644 (file)
@@ -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;
                }
 
index 851194b..abda9e3 100644 (file)
@@ -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());
                        }
                }
        }