MCPcopy Create free account
hub / github.com/Kitware/CMake / copyString

Function copyString

Utilities/cmexpat/lib/xmlparse.c:8435–8454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8433}
8434
8435static XML_Char *
8436copyString(const XML_Char *s, XML_Parser parser) {
8437 size_t charsRequired = 0;
8438 XML_Char *result;
8439
8440 /* First determine how long the string is */
8441 while (s[charsRequired] != 0) {
8442 charsRequired++;
8443 }
8444 /* Include the terminator */
8445 charsRequired++;
8446
8447 /* Now allocate space for the copy */
8448 result = MALLOC(parser, charsRequired * sizeof(XML_Char));
8449 if (result == NULL)
8450 return NULL;
8451 /* Copy the original into place */
8452 memcpy(result, s, charsRequired * sizeof(XML_Char));
8453 return result;
8454}
8455
8456#if XML_GE == 1
8457

Callers 2

parserInitFunction · 0.85
XML_SetEncodingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…