From aa3a5ccb5226f6e260b186d317ed2b4afbf01bba Mon Sep 17 00:00:00 2001 From: yichengzhao Date: Fri, 1 Jul 2022 16:35:22 +0800 Subject: [PATCH] fix warn Signed-off-by: yichengzhao Change-Id: Ifcb8bb07eb8ca6c8424967385555a31d57fe2bb1 --- util/src/sandbox_utils.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/src/sandbox_utils.cpp b/util/src/sandbox_utils.cpp index fddc2a18..ffdc0392 100644 --- a/util/src/sandbox_utils.cpp +++ b/util/src/sandbox_utils.cpp @@ -221,17 +221,17 @@ unsigned long SandboxUtils::GetMountFlagsFromConfig(const std::vectorbundleName; bundleNameIndex = bundleNameIndex + "_" + std::to_string(appProperty->bundleIndex); path = replace_all(path, PACKAGE_NAME_INDEX, bundleNameIndex); } - if (path.find(PACKAGE_NAME) != -1) { + if (path.find(PACKAGE_NAME) != std::string::npos) { path = replace_all(path, PACKAGE_NAME, appProperty->bundleName); } - if (path.find(USERID) != -1) { + if (path.find(USERID) != std::string::npos) { path = replace_all(path, USERID, std::to_string(appProperty->uid / UID_BASE)); } @@ -334,7 +334,7 @@ static int32_t HandleSpecialAppMount(const ClientSocket::AppProperty *appPropert /* dlp application mount strategy */ /* dlp is an example, we should change to real bundle name later */ - if (bundleName.find(DLP_BUNDLENAME) != -1) { + if (bundleName.find(DLP_BUNDLENAME) != std::string::npos) { if (fsType.empty()) { return -1; } else { -- Gitee