summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlad Tsyrklevich <vtsyrklevich@google.com>2017-08-10 15:08:48 -0700
committerNick Wellnhofer <wellnhofer@aevum.de>2017-11-09 13:43:08 +0100
commit28f52fe89dccf9c0a99a905522be8194230c4e77 (patch)
tree2598d510988b558a5e0d990727eb29925cfc19d3
parent72182550926d31ad17357bd3ed69e49d7e69df02 (diff)
downloadlibxml2-28f52fe89dccf9c0a99a905522be8194230c4e77.tar.gz
Refactor name and type signature for xmlNop
Update xmlNop's name to xmlInputReadCallbackNop and its type signature to match xmlInputReadCallback. Fixes bug 786134.
-rw-r--r--libxml.h2
-rw-r--r--parser.c3
-rw-r--r--xmlIO.c10
3 files changed, 9 insertions, 6 deletions
diff --git a/libxml.h b/libxml.h
index 4fe56d21..2efa7047 100644
--- a/libxml.h
+++ b/libxml.h
@@ -96,7 +96,7 @@ int __xmlRandom(void);
#endif
XMLPUBFUN xmlChar * XMLCALL xmlEscapeFormatString(xmlChar **msg);
-int xmlNop(void);
+int xmlInputReadCallbackNop(void *context, char *buffer, int len);
#ifdef IN_LIBXML
#ifdef __GNUC__
diff --git a/parser.c b/parser.c
index 1c5e036e..515ced5f 100644
--- a/parser.c
+++ b/parser.c
@@ -2086,7 +2086,8 @@ static void xmlGROW (xmlParserCtxtPtr ctxt) {
if (((curEnd > (unsigned long) XML_MAX_LOOKUP_LIMIT) ||
(curBase > (unsigned long) XML_MAX_LOOKUP_LIMIT)) &&
- ((ctxt->input->buf) && (ctxt->input->buf->readcallback != (xmlInputReadCallback) xmlNop)) &&
+ ((ctxt->input->buf) &&
+ (ctxt->input->buf->readcallback != xmlInputReadCallbackNop)) &&
((ctxt->options & XML_PARSE_HUGE) == 0)) {
xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "Huge input lookup");
xmlHaltParser(ctxt);
diff --git a/xmlIO.c b/xmlIO.c
index 0fd8c496..1d490954 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -703,14 +703,16 @@ xmlCheckFilename (const char *path)
}
/**
- * xmlNop:
+ * xmlInputReadCallbackNop:
*
- * No Operation function, does nothing, no input
+ * No Operation xmlInputReadCallback function, does nothing.
*
* Returns zero
*/
int
-xmlNop(void) {
+xmlInputReadCallbackNop(void *context ATTRIBUTE_UNUSED,
+ char *buffer ATTRIBUTE_UNUSED,
+ int len ATTRIBUTE_UNUSED) {
return(0);
}
@@ -2932,7 +2934,7 @@ xmlParserInputBufferCreateMem(const char *mem, int size, xmlCharEncoding enc) {
ret = xmlAllocParserInputBuffer(enc);
if (ret != NULL) {
ret->context = (void *) mem;
- ret->readcallback = (xmlInputReadCallback) xmlNop;
+ ret->readcallback = xmlInputReadCallbackNop;
ret->closecallback = NULL;
errcode = xmlBufAdd(ret->buffer, (const xmlChar *) mem, size);
if (errcode != 0) {