cursor_ is not directly represent the hexadecimal

Change-Id: Ibdbd0e2f85284c1443403ed8c43acbd6e9de635f
This commit is contained in:
Hiroshi Matsunaga 2015-01-09 03:38:14 +09:00 committed by Wouter van Oortmerssen
parent 4fb5a764df
commit 7cf74cb864
1 changed files with 2 additions and 1 deletions

View File

@ -124,7 +124,8 @@ int64_t Parser::ParseHexNum(int nibbles) {
if (!isxdigit(cursor_[i])) if (!isxdigit(cursor_[i]))
Error("escape code must be followed by " + NumToString(nibbles) + Error("escape code must be followed by " + NumToString(nibbles) +
" hex digits"); " hex digits");
auto val = StringToInt(cursor_, 16); std::string target(cursor_, cursor_ + nibbles);
auto val = StringToInt(target.c_str(), 16);
cursor_ += nibbles; cursor_ += nibbles;
return val; return val;
} }