From 5349d505c1c10a766c02f954243b5bf396107258 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sun, 19 Jun 2022 13:49:59 +0200 Subject: [PATCH] [js] add_bytes_to_string --- src/ecmascript/quickjs/element.c | 4 ++-- src/ecmascript/spidermonkey/element.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ecmascript/quickjs/element.c b/src/ecmascript/quickjs/element.c index afa50d7ea..4a130d60a 100644 --- a/src/ecmascript/quickjs/element.c +++ b/src/ecmascript/quickjs/element.c @@ -676,7 +676,7 @@ walk_tree(struct string *buf, void *nod, bool start, bool toSortAttrs) const auto textNode = dynamic_cast(node); if (textNode) { - add_to_string(buf, textNode->get_content().c_str()); + add_bytes_to_string(buf, textNode->get_content().c_str(), textNode->get_content().length()); } else { auto element = dynamic_cast(node); @@ -710,7 +710,7 @@ walk_tree_content(struct string *buf, xmlpp::Node *node) const auto nodeText = dynamic_cast(node); if (nodeText) { - add_to_string(buf, nodeText->get_content().c_str()); + add_bytes_to_string(buf, nodeText->get_content().c_str(), nodeText->get_content().length()); } auto childs = node->get_children(); diff --git a/src/ecmascript/spidermonkey/element.c b/src/ecmascript/spidermonkey/element.c index 8ca67a917..aa743bb88 100644 --- a/src/ecmascript/spidermonkey/element.c +++ b/src/ecmascript/spidermonkey/element.c @@ -1638,7 +1638,7 @@ walk_tree(struct string *buf, void *nod, bool start, bool toSortAttrs) const auto textNode = dynamic_cast(node); if (textNode) { - add_to_string(buf, textNode->get_content().c_str()); + add_bytes_to_string(buf, textNode->get_content().c_str(), textNode->get_content().length()); } else { auto element = dynamic_cast(node); @@ -1672,7 +1672,7 @@ walk_tree_content(struct string *buf, xmlpp::Node *node) const auto nodeText = dynamic_cast(node); if (nodeText) { - add_to_string(buf, nodeText->get_content().c_str()); + add_bytes_to_string(buf, nodeText->get_content().c_str(), nodeText->get_content().length()); } auto childs = node->get_children();