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:
3
error.c
3
error.c
@@ -1175,6 +1175,9 @@ xmlErrString(xmlParserErrors code) {
|
||||
case XML_ERR_UNSUPPORTED_ENCODING:
|
||||
errmsg = "Unsupported encoding";
|
||||
break;
|
||||
case XML_ERR_INVALID_CHAR:
|
||||
errmsg = "Invalid character";
|
||||
break;
|
||||
|
||||
case XML_IO_UNKNOWN:
|
||||
errmsg = "Unknown IO error"; break;
|
||||
|
||||
@@ -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:
|
||||
* @c: an unicode character (int)
|
||||
@@ -766,8 +749,8 @@ xmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
|
||||
* TODO: Null bytes should be handled by callers,
|
||||
* but this can be tricky.
|
||||
*/
|
||||
xmlErrEncodingInt(ctxt, XML_ERR_INVALID_CHAR,
|
||||
"Char 0x0 out of allowed range\n", c);
|
||||
xmlFatalErr(ctxt, XML_ERR_INVALID_CHAR,
|
||||
"Char 0x0 out of allowed range\n");
|
||||
}
|
||||
} else {
|
||||
*len = 1;
|
||||
|
||||
@@ -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>
|
||||
^
|
||||
./test/errors/trailing-null-2.xml:1: parser error : PCDATA invalid Char value 0
|
||||
|
||||
@@ -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>
|
||||
^
|
||||
./test/errors/trailing-null-2.xml:1: parser error : PCDATA invalid Char value 0
|
||||
|
||||
@@ -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>
|
||||
^
|
||||
./test/errors/trailing-null-2.xml:1: parser error : PCDATA invalid Char value 0
|
||||
|
||||
Reference in New Issue
Block a user