Fix a sign-compare compiler warning

This commit is contained in:
Jon Siwek 2019-07-11 12:13:48 -07:00
parent 1f329ad541
commit cb292af84d
3 changed files with 6 additions and 2 deletions

View file

@ -1,4 +1,8 @@
2.6-587 | 2019-07-11 12:13:48 -0700
* Fix a sign-compare compiler warning (Jon Siwek, Corelight)
2.6-586 | 2019-07-11 11:15:40 -0700 2.6-586 | 2019-07-11 11:15:40 -0700
* Convert all JSON output to use an external library for better consistency (Tim Wojtulewicz, Corelight) * Convert all JSON output to use an external library for better consistency (Tim Wojtulewicz, Corelight)

View file

@ -1 +1 @@
2.6-586 2.6-587

View file

@ -1911,7 +1911,7 @@ string json_escape_utf8(const string& val)
// The next bit is based on the table at https://en.wikipedia.org/wiki/UTF-8#Description. // The next bit is based on the table at https://en.wikipedia.org/wiki/UTF-8#Description.
// If next character is 11110xxx, this is a 4-byte UTF-8 // If next character is 11110xxx, this is a 4-byte UTF-8
int char_size = 0; unsigned int char_size = 0;
if ( (val[idx] & 0xF8) == 0xF0 ) char_size = 4; if ( (val[idx] & 0xF8) == 0xF0 ) char_size = 4;
// If next character is 1110xxxx, this is a 3-byte UTF-8 // If next character is 1110xxxx, this is a 3-byte UTF-8