From 43499d9b9f9470691feca33d313721da4fccb78a Mon Sep 17 00:00:00 2001 From: joe49 Date: Wed, 10 Aug 2022 18:24:50 +0800 Subject: [PATCH] fix codestyle Signed-off-by: joe49 --- .../common/distributedhardwarefwkkit/src/start_dhfwk_tool.cpp | 3 ++- utils/src/dh_utils_tool.cpp | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/interfaces/inner_kits/test/unittest/common/distributedhardwarefwkkit/src/start_dhfwk_tool.cpp b/interfaces/inner_kits/test/unittest/common/distributedhardwarefwkkit/src/start_dhfwk_tool.cpp index 25696839..a7a2ddae 100644 --- a/interfaces/inner_kits/test/unittest/common/distributedhardwarefwkkit/src/start_dhfwk_tool.cpp +++ b/interfaces/inner_kits/test/unittest/common/distributedhardwarefwkkit/src/start_dhfwk_tool.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include "iservice_registry.h" @@ -71,7 +72,7 @@ void StartDHFWKTool::KillProcess(const char *processname) } char cmd[128] = ""; - int32_t ret = sprintf(cmd, "kill -9 $(pidof %s)", processname); + int32_t ret = sprintf_s(cmd, sizeof(cmd), "kill -9 $(pidof %s)", processname); if (ret < 0) { DHLOGE("Kill Process error, cmd: %s, ret: " PRId32, cmd, ret); return; diff --git a/utils/src/dh_utils_tool.cpp b/utils/src/dh_utils_tool.cpp index a2c78fac..a800a0df 100644 --- a/utils/src/dh_utils_tool.cpp +++ b/utils/src/dh_utils_tool.cpp @@ -17,8 +17,6 @@ #include #include -#include -#include #include #include #include -- Gitee