Ensure ; immediately follows the code in &#<hex/dec>;
This commit is contained in:
parent
5aeab9da9d
commit
cf86aaebca
8
tvdb.c
8
tvdb.c
|
@ -53,10 +53,12 @@ unescape(char *txt)
|
|||
|
||||
for (; (p = strchr(p, '&')); p++)
|
||||
{
|
||||
int ll;
|
||||
int ll = 0;
|
||||
unsigned char icode;
|
||||
if (1 == sscanf( p, "&#%hhu;%n", &icode, &ll) ||
|
||||
1 == sscanf( p, "&#%*[xX]%hhx;%n", &icode, &ll)) {
|
||||
/* sscanf -> 1: the code was read; ll>0: ';' came next */
|
||||
if ((1 == sscanf( p, "&#%hhu;%n", &icode, &ll) ||
|
||||
1 == sscanf( p, "&#%*[xX]%hhx;%n", &icode, &ll)) &&
|
||||
ll > 0) {
|
||||
/* &#x<hex>;, &#<decimal>; */
|
||||
HANDLE(p, (char)icode, ll-1);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue