I'm trying to make a copy of an in memory XML buffer. Based on the
sample code on the website (testWriter.c, the testXmlwriterMemory
function) I want to copy it to a buffer instead of writing to a file.
However, what I tried was:

char *xmldata = malloc(buf->use);
memcpy(xmldata, buf->content, buf->use);

However, this doesn't quite work. If buf->content is a string "abcd"
buf->use will be 4. This doesn't count for any kind of string
terminator. Should it?

Or does the application have to add the string terminator itself?


Thanks,
Gilles`
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to