1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-24 13:33:01 +03:00

parser: Remove xmlErrEncodingInt

Convert the last user to xmlFatalErr.
This commit is contained in:
Nick Wellnhofer
2024-01-03 18:12:29 +01:00
parent f30b9b2331
commit d0eb5a7e54
5 changed files with 11 additions and 22 deletions

View File

@@ -1175,6 +1175,9 @@ xmlErrString(xmlParserErrors code) {
case XML_ERR_UNSUPPORTED_ENCODING: case XML_ERR_UNSUPPORTED_ENCODING:
errmsg = "Unsupported encoding"; errmsg = "Unsupported encoding";
break; break;
case XML_ERR_INVALID_CHAR:
errmsg = "Invalid character";
break;
case XML_IO_UNKNOWN: case XML_IO_UNKNOWN:
errmsg = "Unknown IO error"; break; errmsg = "Unknown IO error"; break;

View File

@@ -338,23 +338,6 @@ xmlFatalErr(xmlParserCtxtPtr ctxt, xmlParserErrors code, const char *info)
} }
} }
/**
* xmlErrEncodingInt:
* @ctxt: an XML parser context
* @error: the error number
* @msg: the error message
* @val: an integer value
*
* n encoding error
*/
static void LIBXML_ATTR_FORMAT(3,0)
xmlErrEncodingInt(xmlParserCtxtPtr ctxt, xmlParserErrors error,
const char *msg, int val)
{
xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
NULL, NULL, NULL, val, msg, val);
}
/** /**
* xmlIsLetter: * xmlIsLetter:
* @c: an unicode character (int) * @c: an unicode character (int)
@@ -766,8 +749,8 @@ xmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
* TODO: Null bytes should be handled by callers, * TODO: Null bytes should be handled by callers,
* but this can be tricky. * but this can be tricky.
*/ */
xmlErrEncodingInt(ctxt, XML_ERR_INVALID_CHAR, xmlFatalErr(ctxt, XML_ERR_INVALID_CHAR,
"Char 0x0 out of allowed range\n", c); "Char 0x0 out of allowed range\n");
} }
} else { } else {
*len = 1; *len = 1;

View File

@@ -1,4 +1,5 @@
./test/errors/trailing-null-2.xml:1: parser error : Char 0x0 out of allowed range ./test/errors/trailing-null-2.xml:1: parser error : Invalid character: Char 0x0 out of allowed range
<d> <d>
^ ^
./test/errors/trailing-null-2.xml:1: parser error : PCDATA invalid Char value 0 ./test/errors/trailing-null-2.xml:1: parser error : PCDATA invalid Char value 0

View File

@@ -1,4 +1,5 @@
./test/errors/trailing-null-2.xml:1: parser error : Char 0x0 out of allowed range ./test/errors/trailing-null-2.xml:1: parser error : Invalid character: Char 0x0 out of allowed range
<d> <d>
^ ^
./test/errors/trailing-null-2.xml:1: parser error : PCDATA invalid Char value 0 ./test/errors/trailing-null-2.xml:1: parser error : PCDATA invalid Char value 0

View File

@@ -1,4 +1,5 @@
./test/errors/trailing-null-2.xml:1: parser error : Char 0x0 out of allowed range ./test/errors/trailing-null-2.xml:1: parser error : Invalid character: Char 0x0 out of allowed range
<d> <d>
^ ^
./test/errors/trailing-null-2.xml:1: parser error : PCDATA invalid Char value 0 ./test/errors/trailing-null-2.xml:1: parser error : PCDATA invalid Char value 0