Fixed SkipByteOrderMark advancing cursor_ too early.
Change-Id: Ie60f01d935ca6b4aa6ce0eab7598602ac0758342 Tested: on Linux.
This commit is contained in:
parent
fd542c71e3
commit
f6330ab8f1
|
@ -205,8 +205,10 @@ CheckedError Parser::ParseHexNum(int nibbles, int64_t *val) {
|
||||||
CheckedError Parser::SkipByteOrderMark() {
|
CheckedError Parser::SkipByteOrderMark() {
|
||||||
if (static_cast<unsigned char>(*cursor_) != 0xef) return NoError();
|
if (static_cast<unsigned char>(*cursor_) != 0xef) return NoError();
|
||||||
cursor_++;
|
cursor_++;
|
||||||
if (static_cast<unsigned char>(*cursor_++) != 0xbb) return Error("invalid utf-8 byte order mark");
|
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");
|
cursor_++;
|
||||||
|
if (static_cast<unsigned char>(*cursor_) != 0xbf) return Error("invalid utf-8 byte order mark");
|
||||||
|
cursor_++;
|
||||||
return NoError();
|
return NoError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue