Skip to content

Commit 207c754

Browse files
committed
Merge pull request #7 from luksow/easy-content-fix
Fix for xml_easy_content() for nodes with no content
2 parents 03b2d82 + 7b4dd4b commit 207c754

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/xml.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ static _Bool xml_string_equals(struct xml_string* a, struct xml_string* b) {
143143
* [PRIVATE]
144144
*/
145145
static uint8_t* xml_string_clone(struct xml_string* s) {
146+
if (!s) {
147+
return 0;
148+
}
149+
146150
uint8_t* clone = calloc(s->length + 1, sizeof(uint8_t));
147151

148152
xml_string_copy(s, clone, s->length);

0 commit comments

Comments
 (0)