summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/kit.inl.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/kit.inl.h b/include/kit.inl.h
index 7b7407d..aa3740d 100644
--- a/include/kit.inl.h
+++ b/include/kit.inl.h
@@ -1942,6 +1942,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
@@ -4576,7 +4577,8 @@ static kit_status_t kit_xml_append_text_(str_builder_t *buf,
assert(buf->size == n + xml->text.size);
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,
xml->children.values + i);
@@ -4590,7 +4592,8 @@ static kit_status_t kit_xml_append_text_(str_builder_t *buf,
assert(buf->size == n + tail.size);
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;
}