Merge pull request #375 from htacg/issue-373

Issue 373
This commit is contained in:
Geoff McLane 2016-02-24 19:21:26 +01:00
commit 771b5607f2
2 changed files with 17 additions and 7 deletions

View file

@ -352,6 +352,7 @@ uint EntityCode( ctmbstr name, uint versions )
Bool TY_(EntityInfo)( ctmbstr name, Bool isXml, uint* code, uint* versions )
{
const entity* np;
int res;
assert( name && name[0] == '&' );
assert( code != NULL );
assert( versions != NULL );
@ -363,13 +364,23 @@ Bool TY_(EntityInfo)( ctmbstr name, Bool isXml, uint* code, uint* versions )
/* 'x' prefix denotes hexadecimal number format */
if ( name[2] == 'x' || (!isXml && name[2] == 'X') )
sscanf( name+3, "%x", &c );
res = sscanf( name+3, "%x", &c );
else
sscanf( name+2, "%u", &c );
res = sscanf( name+2, "%u", &c );
*code = c;
*versions = VERS_ALL;
return yes;
/* Issue #373 - Null Char in XML result doc - sf905 2009 */
if ( res == 1 )
{
*code = c;
*versions = VERS_ALL;
return yes;
}
else
{
*code = 0;
*versions = ( isXml ? VERS_XML : VERS_PROPRIETARY );
return no;
}
}
/* Named entity: name ="&" followed by a name */

View file

@ -1,3 +1,2 @@
5.1.41
5.1.41issue-373
2016.02.18