From ade85a0ac2a6be527ae504ea801e3dfaea69a676 Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Sat, 23 Sep 2023 08:28:06 +0200 Subject: OpenGL registry --- include/kit.inl.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include') 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; } -- cgit v1.2.3