From c60121268be8482a4ff5be7870c3c25f8b010ff9 Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Wed, 14 Dec 2022 12:34:29 -0300 Subject: [PATCH] mxml_write_node: ensure there is a space between attributes Some buggy XML parsers used in commercial ACS's can't handle LF as blank space separating attributes, so always issue a space between attributes, even if we just added a LF. https://support.easycwmp.org/view.php?id=141 --- mxml-file.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mxml-file.c b/mxml-file.c index 02eca9d..4875189 100644 --- a/mxml-file.c +++ b/mxml-file.c @@ -2790,13 +2790,11 @@ mxml_write_node(mxml_node_t *node, /* I - Node to write */ col = 0; } - else - { - if ((*putc_cb)(' ', p) < 0) - return (-1); - col ++; - } + /* https://support.easycwmp.org/view.php?id=141 */ + if ((*putc_cb)(' ', p) < 0) + return (-1); + col ++; if (mxml_write_name(attr->name, p, putc_cb) < 0) return (-1);