fixed a bug where too many hex digits were read for \x
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401057
This commit is contained in:
parent
904aceb435
commit
998c9dc574
@ -2329,18 +2329,22 @@ static cell litchar(const unsigned char **lptr,int flags)
|
|||||||
cptr+=1;
|
cptr+=1;
|
||||||
break;
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
|
{
|
||||||
|
int digits = 0;
|
||||||
cptr+=1;
|
cptr+=1;
|
||||||
c=0;
|
c=0;
|
||||||
while (ishex(*cptr)) {
|
while (ishex(*cptr) && digits < 2) {
|
||||||
if (isdigit(*cptr))
|
if (isdigit(*cptr))
|
||||||
c=(c<<4)+(*cptr-'0');
|
c=(c<<4)+(*cptr-'0');
|
||||||
else
|
else
|
||||||
c=(c<<4)+(tolower(*cptr)-'a'+10);
|
c=(c<<4)+(tolower(*cptr)-'a'+10);
|
||||||
cptr++;
|
cptr++;
|
||||||
|
digits++;
|
||||||
} /* while */
|
} /* while */
|
||||||
if (*cptr==';')
|
if (*cptr==';')
|
||||||
cptr++; /* swallow a trailing ';' */
|
cptr++; /* swallow a trailing ';' */
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case '\'': /* \' == ' (single quote) */
|
case '\'': /* \' == ' (single quote) */
|
||||||
case '"': /* \" == " (single quote) */
|
case '"': /* \" == " (single quote) */
|
||||||
case '%': /* \% == % (percent) */
|
case '%': /* \% == % (percent) */
|
||||||
|
Loading…
Reference in New Issue
Block a user