mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-05 04:58:57 +00:00
Fixed SkipByteOrderMark advancing cursor_ too early.
Change-Id: Ie60f01d935ca6b4aa6ce0eab7598602ac0758342 Tested: on Linux.
This commit is contained in:
@@ -205,8 +205,10 @@ CheckedError Parser::ParseHexNum(int nibbles, int64_t *val) {
|
||||
CheckedError Parser::SkipByteOrderMark() {
|
||||
if (static_cast<unsigned char>(*cursor_) != 0xef) return NoError();
|
||||
cursor_++;
|
||||
if (static_cast<unsigned char>(*cursor_++) != 0xbb) return Error("invalid utf-8 byte order mark");
|
||||
if (static_cast<unsigned char>(*cursor_++) != 0xbf) return Error("invalid utf-8 byte order mark");
|
||||
if (static_cast<unsigned char>(*cursor_) != 0xbb) return Error("invalid utf-8 byte order mark");
|
||||
cursor_++;
|
||||
if (static_cast<unsigned char>(*cursor_) != 0xbf) return Error("invalid utf-8 byte order mark");
|
||||
cursor_++;
|
||||
return NoError();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user