Hello,
I am wondering if I declare a array of chars like this.
Code:
static char xml_buffer[1024];
I am clearing the array before I fill it by using one of the following. By setting the first char to zero:
or is this preferred?
Code:
memset(xml_buffer, 0, sizeof(xml_buffer));
However, the problem is when I fill the buffer I don't think the null is being inserted at the end of the string.
I am using a xml parser that will fill the buffer.
Code:
success = xmlFillString(tree, xml_buffer, sizeof(xml_buffer), XML_NO_CALLBACK);
I don't think the null is being automatically appended and the documentation doesn't specify either? Could be I am not clearing the buffer, or is there any way to do this manually?
Many thanks,