Commit 56b4d5a6108f9b633d890e7cdc2d769128479651
1 parent
f7ac5915
Use val.at instead of val[]
Showing
1 changed file
with
3 additions
and
3 deletions
libqpdf/QPDF_String.cc
| @@ -184,9 +184,9 @@ QPDF_String::getUTF8Val() const | @@ -184,9 +184,9 @@ QPDF_String::getUTF8Val() const | ||
| 184 | return QUtil::utf16_to_utf8(this->val); | 184 | return QUtil::utf16_to_utf8(this->val); |
| 185 | } | 185 | } |
| 186 | else if ((val.length() >= 3) && | 186 | else if ((val.length() >= 3) && |
| 187 | - (val[0] == '\xEF') && | ||
| 188 | - (val[1] == '\xBB') && | ||
| 189 | - (val[2] == '\xBF')) | 187 | + (val.at(0) == '\xEF') && |
| 188 | + (val.at(1) == '\xBB') && | ||
| 189 | + (val.at(2) == '\xBF')) | ||
| 190 | { | 190 | { |
| 191 | // PDF 2.0 allows UTF-8 strings when explicitly prefixed with | 191 | // PDF 2.0 allows UTF-8 strings when explicitly prefixed with |
| 192 | // the above bytes, which is just UTF-8 encoding of U+FEFF. | 192 | // the above bytes, which is just UTF-8 encoding of U+FEFF. |