* Fix bug spotted by Rimas Kudelis : if an escaped sequence (such as \xA9) was immediately followed by other digits,

collectcatkeys parsed all the digits instead of just the two associated to the \x, leading to wrong characters in thecatkeys 
file.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37586 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues 2010-07-19 11:21:11 +00:00
parent 7235f8680c
commit e2cc7215e8
2 changed files with 10 additions and 2 deletions

View File

@ -161,7 +161,11 @@ parseQuotedChars(BString& stringToParse)
*out = '"';
else if (*in == 'x') {
// Parse the 2-digit hex integer that follows
unsigned int hexchar = strtoul(in + 1, NULL, 16);
char tmp[3];
tmp[0] = *(in+1);
tmp[1] = *(in+2);
tmp[3] = '\0';
unsigned int hexchar = strtoul(tmp, NULL, 16);
*out = hexchar;
// skip the number
in += 2;

View File

@ -165,7 +165,11 @@ parseQuotedChars(BString& stringToParse)
*out = '"';
else if (*in == 'x') {
// Parse the 2-digit hex integer that follows
unsigned int hexchar = strtoul(in + 1, NULL, 16);
char tmp[3];
tmp[0] = *(in+1);
tmp[1] = *(in+2);
tmp[3] = '\0';
unsigned int hexchar = strtoul(tmp, NULL, 16);
*out = hexchar;
// skip the number
in += 2;