2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-16 01:27:07 +00:00

Use val.at instead of val[]

This commit is contained in:
Jay Berkenbilt 2022-02-22 08:40:49 -05:00
parent f7ac591590
commit 56b4d5a610

View File

@ -184,9 +184,9 @@ QPDF_String::getUTF8Val() const
return QUtil::utf16_to_utf8(this->val); return QUtil::utf16_to_utf8(this->val);
} }
else if ((val.length() >= 3) && else if ((val.length() >= 3) &&
(val[0] == '\xEF') && (val.at(0) == '\xEF') &&
(val[1] == '\xBB') && (val.at(1) == '\xBB') &&
(val[2] == '\xBF')) (val.at(2) == '\xBF'))
{ {
// PDF 2.0 allows UTF-8 strings when explicitly prefixed with // PDF 2.0 allows UTF-8 strings when explicitly prefixed with
// the above bytes, which is just UTF-8 encoding of U+FEFF. // the above bytes, which is just UTF-8 encoding of U+FEFF.