summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/kit/xml.c6
-rw-r--r--source/kit/xml.h1
2 files changed, 5 insertions, 2 deletions
diff --git a/source/kit/xml.c b/source/kit/xml.c
index a9d18e3..c62ee82 100644
--- a/source/kit/xml.c
+++ b/source/kit/xml.c
@@ -373,7 +373,8 @@ static kit_status_t kit_xml_append_text_(str_builder_t *buf,
if (buf->size != n + xml->text.size)
return KIT_ERROR_BAD_ALLOC;
- memcpy(buf->values + n, xml->text.values, xml->text.size);
+ if (xml->text.size > 0)
+ memcpy(buf->values + n, xml->text.values, xml->text.size);
for (i64 i = 0; i < xml->children.size; i++) {
kit_status_t s = kit_xml_append_text_(buf,
@@ -393,7 +394,8 @@ static kit_status_t kit_xml_append_text_(str_builder_t *buf,
if (buf->size != n + tail.size)
return KIT_ERROR_BAD_ALLOC;
- memcpy(buf->values + n, tail.values, tail.size);
+ if (tail.size > 0)
+ memcpy(buf->values + n, tail.values, tail.size);
}
return KIT_OK;
diff --git a/source/kit/xml.h b/source/kit/xml.h
index 6e04878..0bd5744 100644
--- a/source/kit/xml.h
+++ b/source/kit/xml.h
@@ -55,6 +55,7 @@ void kit_xml_destroy(kit_xml_t *xml);
# define xml_full_text kit_xml_full_text
# define xml_destroy kit_xml_destroy
# define xml_t kit_xml_t
+# define xml_property_t kit_xml_property_t
# define xml_parse_result_t kit_xml_parse_result_t
# define xml_text_t kit_xml_text_t
#endif