Merge "Fix build error from signed/unsigned comparison"

This commit is contained in:
Treehugger Robot 2022-03-29 23:13:51 +00:00 committed by Gerrit Code Review
commit 98c7076202

View file

@ -313,7 +313,7 @@ status_t String8::appendFormatV(const char* fmt, va_list args)
if (n > 0) {
size_t oldLength = length();
if (n > std::numeric_limits<size_t>::max() - 1 ||
if (static_cast<size_t>(n) > std::numeric_limits<size_t>::max() - 1 ||
oldLength > std::numeric_limits<size_t>::max() - n - 1) {
return NO_MEMORY;
}