xmltok.c: Use memcpy instead of copying single bytes (fixes #282)

Fixes cppcheck's complaint as a side-effect.
This commit is contained in:
Sebastian Pipping 2019-07-17 16:21:31 +02:00
parent c5b3ce0932
commit d4d8d486af

View file

@ -1502,8 +1502,7 @@ XmlInitUnknownEncoding(void *mem,
{
int i;
struct unknown_encoding *e = (struct unknown_encoding *)mem;
for (i = 0; i < (int)sizeof(struct normal_encoding); i++)
((char *)mem)[i] = ((char *)&latin1_encoding)[i];
memcpy(mem, &latin1_encoding, sizeof(struct normal_encoding));
for (i = 0; i < 128; i++)
if (latin1_encoding.type[i] != BT_OTHER
&& latin1_encoding.type[i] != BT_NONXML