From 5e7874015ef5ed8b2705eb2f7b0960f56f7760ea Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Tue, 10 Sep 2024 17:12:25 +0200 Subject: [PATCH] save: Make xmlEscapeTab signed Fixes issues in platforms where char is unsigned. Fixes #797. --- xmlsave.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xmlsave.c b/xmlsave.c index 24b279c9..d0492ee4 100644 --- a/xmlsave.c +++ b/xmlsave.c @@ -128,7 +128,7 @@ static const char xmlEscapeContent[] = { ';', }; -static const char xmlEscapeTab[128] = { +static const signed char xmlEscapeTab[128] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 20, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -139,7 +139,7 @@ static const char xmlEscapeTab[128] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }; -static const char xmlEscapeTabAttr[128] = { +static const signed char xmlEscapeTabAttr[128] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 14, 0, 0, 20, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 26, -1, -1, -1, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -154,7 +154,7 @@ static void xmlSerializeText(xmlOutputBufferPtr buf, const xmlChar *string, unsigned flags) { const char *cur; - const char *tab; + const signed char *tab; if (string == NULL) return;