'\\o{' [0-7]+ '}' => {
string oct(ts + 3, te - ts - 4);
- long int val = strtol(oct.c_str(), nullptr, 8);
+ unsigned long val = stoul(oct, nullptr, 8);
if ((!mode.utf8 && val > 255) || val > MAX_UNICODE) {
throw LocatedParseError("Value in \\o{...} sequence is too large");
}
# Unicode Hex
'\\x{' xdigit+ '}' => {
string hex(ts + 3, te - ts - 4);
- long int val = strtol(hex.c_str(), nullptr, 16);
+ unsigned long val = stoul(hex, nullptr, 16);
if (val > MAX_UNICODE) {
throw LocatedParseError("Value in \\x{...} sequence is too large");
}
};
'\\o{' [0-7]+ '}' => {
string oct(ts + 3, te - ts - 4);
- long int val = strtol(oct.c_str(), nullptr, 8);
+ unsigned long val = stoul(oct, nullptr, 8);
if ((!mode.utf8 && val > 255) || val > MAX_UNICODE) {
throw LocatedParseError("Value in \\o{...} sequence is too large");
}
# Unicode Hex
'\\x{' xdigit+ '}' => {
string hex(ts + 3, te - ts - 4);
- long int val = strtol(hex.c_str(), nullptr, 16);
+ unsigned long val = stoul(hex, nullptr, 16);
if (val > MAX_UNICODE) {
throw LocatedParseError("Value in \\x{...} sequence is too large");
}