aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2015-11-20 15:01:22 +0800
committerDaniel Veillard <veillard@redhat.com>2015-11-20 15:01:22 +0800
commitce0b0d0d81fdbb5f722a890432b52d363e4de57b (patch)
tree6130fd33f9dc83a8a2dcae41d47763038de54535
parente3b1597421ad7cbeb5939fc3b54f43f141c82366 (diff)
downloadandroid_external_libxml2-ce0b0d0d81fdbb5f722a890432b52d363e4de57b.tar.gz
android_external_libxml2-ce0b0d0d81fdbb5f722a890432b52d363e4de57b.tar.bz2
android_external_libxml2-ce0b0d0d81fdbb5f722a890432b52d363e4de57b.zip
Do not print error context when there is none
Which now happens more frequently du to xmlHaltParser use
-rw-r--r--error.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/error.c b/error.c
index cbcf5c96..9c450405 100644
--- a/error.c
+++ b/error.c
@@ -177,7 +177,9 @@ xmlParserPrintFileContextInternal(xmlParserInputPtr input ,
xmlChar content[81]; /* space for 80 chars + line terminator */
xmlChar *ctnt;
- if (input == NULL) return;
+ if ((input == NULL) || (input->cur == NULL) ||
+ (*input->cur == 0)) return;
+
cur = input->cur;
base = input->base;
/* skip backwards over any end-of-lines */