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

Function xmlStrndup

ThirdParty/libxml2/vtklibxml2/xmlstring.c:52–64  ·  view source on GitHub ↗

* xmlStrndup: * @cur: the input xmlChar * * @len: the len of @cur * * a strndup for array of xmlChar's * * Returns a new xmlChar * or NULL */

Source from the content-addressed store, hash-verified

50 * Returns a new xmlChar * or NULL
51 */
52xmlChar *
53xmlStrndup(const xmlChar *cur, int len) {
54 xmlChar *ret;
55
56 if ((cur == NULL) || (len < 0)) return(NULL);
57 ret = (xmlChar *) xmlMallocAtomic((size_t) len + 1);
58 if (ret == NULL) {
59 return(NULL);
60 }
61 memcpy(ret, cur, len);
62 ret[len] = 0;
63 return(ret);
64}
65
66/**
67 * xmlStrdup:

Callers 15

xmlParseSGMLCatalogNameFunction · 0.85
xmlInitializeCatalogFunction · 0.85
xmlLoadCatalogsFunction · 0.85
xmlC14NDocDumpMemoryFunction · 0.85
parsePathFunction · 0.85
xmlNewDocElementContentFunction · 0.85
xmlXPathGetElementsByIdsFunction · 0.85
xmlXPathParseNCNameFunction · 0.85
xmlXPathParseNameFunction · 0.85
xmlXPathParseNameComplexFunction · 0.85
xmlXPathParseLiteralFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected