lib: Leverage memcpy (and xcslen)

This commit is contained in:
Sebastian Pipping 2022-02-19 19:51:41 +01:00
parent 5ab8a21ec8
commit 0b4939645c

View file

@ -8010,12 +8010,9 @@ build_model(XML_Parser parser) {
const XML_Char *src;
dest->name = str;
src = dtd->scaffold[src_node].name;
for (;;) {
*str++ = *src;
if (! *src)
break;
src++;
}
const size_t nameLen = xcslen(src) + /* null terminator*/ 1;
memcpy(str, src, nameLen * sizeof(XML_Char));
str += nameLen;
dest->numchildren = 0;
dest->children = NULL;
} else {