summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2023-09-23 08:28:06 +0200
committerMitya Selivanov <automainint@guattari.tech>2023-09-23 08:28:06 +0200
commitade85a0ac2a6be527ae504ea801e3dfaea69a676 (patch)
tree675bb846861b5dee1244ae6b7095ecb3dac7736b /source
parented9f20507cb3199827feb203159656e233372e44 (diff)
downloadkit-ade85a0ac2a6be527ae504ea801e3dfaea69a676.zip
OpenGL registry
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