Change usage of std::string's .at() to more widely-compatible []. (#5365)

This commit is contained in:
jonsimantov
2019-05-21 14:40:33 -07:00
committed by GitHub
parent 766ed04422
commit 0f7e7fd209

View File

@@ -1327,7 +1327,7 @@ CheckedError Parser::TryTypedValue(const std::string *name, int dtoken,
const auto &s = e.constant;
const auto k = s.find_first_of("0123456789.");
if ((std::string::npos != k) && (s.length() > (k + 1)) &&
(s.at(k) == '0' && is_alpha_char(s.at(k + 1), 'X')) &&
(s[k] == '0' && is_alpha_char(s[k + 1], 'X')) &&
(std::string::npos == s.find_first_of("pP", k + 2))) {
return Error(
"invalid number, the exponent suffix of hexadecimal "