diff --git a/util/src/sandbox_utils.cpp b/util/src/sandbox_utils.cpp index ad1ad18b18a7f48604642e7e68d646d1db41050e..3355795eef9096e17ec86c0169dfa379f0e9a7fd 100644 --- a/util/src/sandbox_utils.cpp +++ b/util/src/sandbox_utils.cpp @@ -152,7 +152,7 @@ static std::vector split(std::string &str, const std::string &patte str += pattern; size_t size = str.size(); - for (int i = 0; i < int(size); i++) { + for (unsigned int i = 0; i < size; i++) { pos = str.find(pattern, i); if (pos < size) { std::string s = str.substr(i, pos - i); @@ -263,9 +263,9 @@ int SandboxUtils::DoAllMntPointsMount(const ClientSocket::AppProperty *appProper nlohmann::json mountPoints = appConfig[MOUNT_PREFIX]; std::string sandboxRoot = GetSbxPathByConfig(appProperty, appConfig); - int mountPointSize = mountPoints.size(); + unsigned int mountPointSize = mountPoints.size(); - for (int i = 0; i < mountPointSize; i++) { + for (unsigned int i = 0; i < mountPointSize; i++) { nlohmann::json mntPoint = mountPoints[i]; // Check the validity of the mount configuration @@ -307,9 +307,9 @@ int SandboxUtils::DoAllSymlinkPointslink(const ClientSocket::AppProperty *appPro nlohmann::json symlinkPoints = appConfig[SYMLINK_PREFIX]; std::string sandboxRoot = GetSbxPathByConfig(appProperty, appConfig); - int symlinkPointSize = symlinkPoints.size(); + unsigned int symlinkPointSize = symlinkPoints.size(); - for (int i = 0; i < symlinkPointSize; i++) { + for (unsigned int i = 0; i < symlinkPointSize; i++) { nlohmann::json symPoint = symlinkPoints[i]; // Check the validity of the symlink configuration