summaryrefslogtreecommitdiff
path: root/entities.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2002-09-05 11:33:25 +0000
committerDaniel Veillard <veillard@src.gnome.org>2002-09-05 11:33:25 +0000
commit3487c8d9bbf0c2d54effc1cd7566c2ececb18752 (patch)
tree1f5a032a6a8970c27cf0a3236088f56475cc3ba9 /entities.c
parent19aa70245a694b3e8ae39da27a8c3deb8d32f405 (diff)
downloadlibxml2-3487c8d9bbf0c2d54effc1cd7566c2ececb18752.tar.gz
get rid of all the perror() calls made in the library execution paths.
* DOCBparser.c HTMLparser.c c14n.c entities.c list.c parser.c parserInternals.c xmlIO.c: get rid of all the perror() calls made in the library execution paths. This should fix both #92059 and #92385 Daniel
Diffstat (limited to 'entities.c')
-rw-r--r--entities.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/entities.c b/entities.c
index efc7b9fd..dbdf9ebf 100644
--- a/entities.c
+++ b/entities.c
@@ -419,9 +419,10 @@ static xmlChar *static_buffer = NULL;
static int growBuffer(void) {
static_buffer_size *= 2;
- static_buffer = (xmlChar *) xmlRealloc(static_buffer, static_buffer_size * sizeof(xmlChar));
+ static_buffer = (xmlChar *) xmlRealloc(static_buffer,
+ static_buffer_size * sizeof(xmlChar));
if (static_buffer == NULL) {
- perror("realloc failed");
+ xmlGenericError(xmlGenericErrorContext, "malloc failed\n");
return(-1);
}
return(0);
@@ -466,9 +467,10 @@ xmlEncodeEntities(xmlDocPtr doc, const xmlChar *input) {
if (static_buffer == NULL) {
static_buffer_size = 1000;
- static_buffer = (xmlChar *) xmlMalloc(static_buffer_size * sizeof(xmlChar));
+ static_buffer = (xmlChar *)
+ xmlMalloc(static_buffer_size * sizeof(xmlChar));
if (static_buffer == NULL) {
- perror("malloc failed");
+ xmlGenericError(xmlGenericErrorContext, "malloc failed\n");
return(NULL);
}
out = static_buffer;
@@ -561,7 +563,7 @@ xmlEncodeEntities(xmlDocPtr doc, const xmlChar *input) {
buffer = (xmlChar *) \
xmlRealloc(buffer, buffer_size * sizeof(xmlChar)); \
if (buffer == NULL) { \
- perror("realloc failed"); \
+ xmlGenericError(xmlGenericErrorContext, "realloc failed\n"); \
return(NULL); \
} \
}
@@ -597,7 +599,7 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
buffer_size = 1000;
buffer = (xmlChar *) xmlMalloc(buffer_size * sizeof(xmlChar));
if (buffer == NULL) {
- perror("malloc failed");
+ xmlGenericError(xmlGenericErrorContext, "malloc failed\n");
return(NULL);
}
out = buffer;
@@ -780,7 +782,7 @@ xmlEncodeSpecialChars(xmlDocPtr doc, const xmlChar *input) {
buffer_size = 1000;
buffer = (xmlChar *) xmlMalloc(buffer_size * sizeof(xmlChar));
if (buffer == NULL) {
- perror("malloc failed");
+ xmlGenericError(xmlGenericErrorContext, "malloc failed\n");
return(NULL);
}
out = buffer;