String8: explicit int -> char cast.
Since tolower/toupper take and return integer arguments, ascii chars in the extended range will be converted from positive int values to negative char values. In order to silence an error here, which was added recently with integer sanitization here, casting explicitly. Fixes: 160831549 Test: w/ libutils_fuzz_string8 Change-Id: Iedcd6643f95f84ce662a80e38931d918a200f508
This commit is contained in:
parent
c8e4154d89
commit
fdbc565dd5
1 changed files with 2 additions and 2 deletions
|
|
@ -424,7 +424,7 @@ void String8::toLower(size_t start, size_t length)
|
|||
char* buf = lockBuffer(len);
|
||||
buf += start;
|
||||
while (length > 0) {
|
||||
*buf = tolower(*buf);
|
||||
*buf = static_cast<char>(tolower(*buf));
|
||||
buf++;
|
||||
length--;
|
||||
}
|
||||
|
|
@ -448,7 +448,7 @@ void String8::toUpper(size_t start, size_t length)
|
|||
char* buf = lockBuffer(len);
|
||||
buf += start;
|
||||
while (length > 0) {
|
||||
*buf = toupper(*buf);
|
||||
*buf = static_cast<char>(toupper(*buf));
|
||||
buf++;
|
||||
length--;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue