aboutsummaryrefslogtreecommitdiffstats
path: root/entities.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2000-01-14 14:45:24 +0000
committerDaniel Veillard <veillard@src.gnome.org>2000-01-14 14:45:24 +0000
commit0142b84bbfd75ae0696604f4f12a1f6383205185 (patch)
tree2d79e7a427860d4b6a95cdc5ba84046aafb15532 /entities.c
parent2eac5039948f9eb591e968162538bc71957a7381 (diff)
downloadandroid_external_libxml2-0142b84bbfd75ae0696604f4f12a1f6383205185.tar.gz
android_external_libxml2-0142b84bbfd75ae0696604f4f12a1f6383205185.tar.bz2
android_external_libxml2-0142b84bbfd75ae0696604f4f12a1f6383205185.zip
Oops, it seems I forgot to commit 1.8.4 changes
- restored xmlNewGlobalNs since this seems used - fixed a problem with INCLUDE_WINSOCK - removed all calls to exit() from the library code. - removed bugs detected by Windows compilers - started adding interfaces for parsing well balanced XML fragments - releasing 1.8.4 - rebuilt the docs Daniel
Diffstat (limited to 'entities.c')
-rw-r--r--entities.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/entities.c b/entities.c
index 027acd05..d6580cfe 100644
--- a/entities.c
+++ b/entities.c
@@ -388,13 +388,14 @@ xmlGetDocEntity(xmlDocPtr doc, const xmlChar *name) {
static int buffer_size = 0;
static xmlChar *buffer = NULL;
-void growBuffer(void) {
+int growBuffer(void) {
buffer_size *= 2;
buffer = (xmlChar *) xmlRealloc(buffer, buffer_size * sizeof(xmlChar));
if (buffer == NULL) {
perror("realloc failed");
- exit(1);
+ return(-1);
}
+ return(0);
}
@@ -437,7 +438,7 @@ xmlEncodeEntities(xmlDocPtr doc, const xmlChar *input) {
buffer = (xmlChar *) xmlMalloc(buffer_size * sizeof(xmlChar));
if (buffer == NULL) {
perror("malloc failed");
- exit(1);
+ return(NULL);
}
out = buffer;
}
@@ -530,10 +531,11 @@ xmlEncodeEntities(xmlDocPtr doc, const xmlChar *input) {
*/
#define growBufferReentrant() { \
buffer_size *= 2; \
- buffer = (xmlChar *) xmlRealloc(buffer, buffer_size * sizeof(xmlChar)); \
+ buffer = (xmlChar *) \
+ xmlRealloc(buffer, buffer_size * sizeof(xmlChar)); \
if (buffer == NULL) { \
perror("realloc failed"); \
- exit(1); \
+ return(NULL); \
} \
}
@@ -572,7 +574,7 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
buffer = (xmlChar *) xmlMalloc(buffer_size * sizeof(xmlChar));
if (buffer == NULL) {
perror("malloc failed");
- exit(1);
+ return(NULL);
}
out = buffer;