Merge pull request #14648 from Linblow/cwcheat-utf8

Detect CwCheat file UTF-8 BOM sequence and ignore it
This commit is contained in:
Henrik Rydgård 2021-07-26 21:28:10 +02:00 committed by GitHub
commit e5db962601
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -98,6 +98,9 @@ bool CheatFileParser::Parse() {
if (!tempLine)
continue;
// Detect UTF-8 BOM sequence, and ignore it.
if (line_ == 1 && memcmp(tempLine, "\xEF\xBB\xBF", 3) == 0)
tempLine += 3;
std::string line = TrimString(tempLine);
// Minimum length 5 is shortest possible _ lines name of the game "_G N+"