[libxml2] Do not print error context when there is none
- From: Daniel Veillard <veillard src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Do not print error context when there is none
- Date: Fri, 20 Nov 2015 09:57:23 +0000 (UTC)
commit ce0b0d0d81fdbb5f722a890432b52d363e4de57b
Author: Daniel Veillard <veillard redhat com>
Date: Fri Nov 20 15:01:22 2015 +0800
Do not print error context when there is none
Which now happens more frequently du to xmlHaltParser use
error.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/error.c b/error.c
index cbcf5c9..9c45040 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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]