MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlSBufFinish

Function xmlSBufFinish

ThirdParty/libxml2/vtklibxml2/parser.c:828–855  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

826}
827
828static xmlChar *
829xmlSBufFinish(xmlSBuf *buf, int *sizeOut, xmlParserCtxtPtr ctxt,
830 const char *errMsg) {
831 if (buf->mem == NULL) {
832 buf->mem = xmlMalloc(1);
833 if (buf->mem == NULL) {
834 buf->code = XML_ERR_NO_MEMORY;
835 } else {
836 buf->mem[0] = 0;
837 }
838 } else {
839 buf->mem[buf->size] = 0;
840 }
841
842 if (buf->code == XML_ERR_OK) {
843 if (sizeOut != NULL)
844 *sizeOut = buf->size;
845 return(buf->mem);
846 }
847
848 xmlSBufReportError(buf, ctxt, errMsg);
849
850 xmlFree(buf->mem);
851
852 if (sizeOut != NULL)
853 *sizeOut = 0;
854 return(NULL);
855}
856
857static void
858xmlSBufCleanup(xmlSBuf *buf, xmlParserCtxtPtr ctxt, const char *errMsg) {

Callers 3

xmlParseEntityValueFunction · 0.85
xmlParseAttValueInternalFunction · 0.85

Calls 1

xmlSBufReportErrorFunction · 0.85

Tested by

no test coverage detected