mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
fix out of bounds error detected in msvc
This commit is contained in:
parent
053508e8b7
commit
8e17339ef0
|
@ -647,17 +647,17 @@ number_format_token number_format_parser::parse_next_token()
|
||||||
switch (current_char)
|
switch (current_char)
|
||||||
{
|
{
|
||||||
case '[':
|
case '[':
|
||||||
do
|
|
||||||
{
|
|
||||||
token.string.push_back(format_string_[position_++]);
|
|
||||||
}
|
|
||||||
while (format_string_[position_] != ']' && position_ < format_string_.size());
|
|
||||||
|
|
||||||
if (position_ == format_string_.size())
|
if (position_ == format_string_.size())
|
||||||
{
|
{
|
||||||
throw std::runtime_error("missing ]");
|
throw std::runtime_error("missing ]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
token.string.push_back(format_string_[position_++]);
|
||||||
|
}
|
||||||
|
while (position_ < format_string_.size() && format_string_[position_] != ']');
|
||||||
|
|
||||||
if (token.string.empty())
|
if (token.string.empty())
|
||||||
{
|
{
|
||||||
throw std::runtime_error("empty []");
|
throw std::runtime_error("empty []");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user