aboutsummaryrefslogtreecommitdiffstats
path: root/entities.c
diff options
context:
space:
mode:
Diffstat (limited to 'entities.c')
-rw-r--r--entities.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/entities.c b/entities.c
index afa871b6..a2306665 100644
--- a/entities.c
+++ b/entities.c
@@ -708,7 +708,10 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
/*
* We could do multiple things here. Just save as a char ref
*/
- snprintf(buf, sizeof(buf), "&#x%X;", val);
+ if (html)
+ snprintf(buf, sizeof(buf), "&#%d;", val);
+ else
+ snprintf(buf, sizeof(buf), "&#x%X;", val);
buf[sizeof(buf) - 1] = 0;
ptr = buf;
while (*ptr != 0) *out++ = *ptr++;