diff --git a/frameworks/native/backup_ext/src/untar_file.cpp b/frameworks/native/backup_ext/src/untar_file.cpp index f78ce3c9dc93679ea0ba7f08178d4e7912ff74e0..87d6f9454459f932e2be3732eca0a1b1f8052e65 100644 --- a/frameworks/native/backup_ext/src/untar_file.cpp +++ b/frameworks/native/backup_ext/src/untar_file.cpp @@ -674,7 +674,7 @@ std::tuple UntarFile::ParsePaxBlock() break; } string pathLen = content.substr(pos, lenEnd - pos); - recLen = std::atoi(pathLen.c_str()); + recLen = static_cast(std::atoi(pathLen.c_str())); allLen = recLen + OTHER_HEADER; if (allLen > BLOCK_SIZE) { isLongName = true; @@ -740,7 +740,7 @@ std::tuple UntarFile::GetLongName(uint32_t recLen, uint32_t al break; } string pathLen = content.substr(pos, lenEnd - pos); - int recLen = std::atoi(pathLen.c_str()); + size_t recLen = static_cast(std::atoi(pathLen.c_str())); string KvPair = content.substr(lenEnd + 1, recLen - (lenEnd - pos + 1)); size_t eqPos = KvPair.find('='); if (eqPos == string::npos) {