1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

Fix xmlTextWriterWriteElement when a null content is given

This commit is contained in:
Daniel Veillard 2014-02-08 02:22:35 +08:00
parent 190a0b8939
commit c9ecf45d1b

View File

@ -2242,10 +2242,12 @@ xmlTextWriterWriteElement(xmlTextWriterPtr writer, const xmlChar * name,
if (count == -1)
return -1;
sum += count;
count = xmlTextWriterWriteString(writer, content);
if (count == -1)
return -1;
sum += count;
if (content != NULL) {
count = xmlTextWriterWriteString(writer, content);
if (count == -1)
return -1;
sum += count;
}
count = xmlTextWriterEndElement(writer);
if (count == -1)
return -1;