Browse Source

Fix for xml_easy_content() for nodes with no content.

Instead of crushing xml_easy_content() returns now NULL when there's no content.
master
Łukasz Sowa 11 years ago
parent
commit
e37d916dfc
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      src/xml.c

+ 3
- 0
src/xml.c View File

@@ -143,6 +143,9 @@ static _Bool xml_string_equals(struct xml_string* a, struct xml_string* b) {
* [PRIVATE] * [PRIVATE]
*/ */
static uint8_t* xml_string_clone(struct xml_string* s) { static uint8_t* xml_string_clone(struct xml_string* s) {
if (!s)
return 0;

uint8_t* clone = calloc(s->length + 1, sizeof(uint8_t)); uint8_t* clone = calloc(s->length + 1, sizeof(uint8_t));


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


Loading…
Cancel
Save