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 25696839ee649c216d729daa0736ec46a306c9a7..06d77a4e77df06d24c5790aa1436ef4295ac45f0 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 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -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 a2c78fac053b4d00232d3346f5b1fd7e4c263e4f..a800a0dfe79b5bd4f5c65b2ead0df9dcadfc586e 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