mirror of
https://github.com/autc04/Retro68.git
synced 2024-12-26 16:29:28 +00:00
fix handling of \n, \r, \t escape sequences in strings
This commit is contained in:
parent
eadbe38cfc
commit
8cd19154a5
@ -45,7 +45,7 @@ static int readInt(const char *str, const char *end = NULL, int baseOverride = 0
|
||||
x += *str - 'A' + 10;
|
||||
else if(*str >= '0' && *str <= '9')
|
||||
x += *str - '0';
|
||||
*str++;
|
||||
str++;
|
||||
}
|
||||
|
||||
return x;
|
||||
@ -86,13 +86,13 @@ static std::string readStringLit(const char *str)
|
||||
switch(*p)
|
||||
{
|
||||
case 'n':
|
||||
out << '\n';
|
||||
out << '\n'; ++p;
|
||||
break;
|
||||
case 'r':
|
||||
out << '\r';
|
||||
out << '\r'; ++p;
|
||||
break;
|
||||
case 't':
|
||||
out << '\t';
|
||||
out << '\t'; ++p;
|
||||
break;
|
||||
case '0':
|
||||
case '1':
|
||||
|
Loading…
Reference in New Issue
Block a user