From 793c0669534b2be58197abaf7f244d87b5faac14 Mon Sep 17 00:00:00 2001 From: Alexander Bluhm Date: Mon, 21 Aug 2017 19:33:08 +0200 Subject: [PATCH] Do not cast arguments of memcpy(3). With an explicit cast, the C compiler does not check whether the function's arguments are compatible and will just convert anything. So removing the cast makes the code safer as the compiler will complain in more cases. The implicit cast does the correct thing. --- expat/lib/xmltok.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/expat/lib/xmltok.c b/expat/lib/xmltok.c index 007aed06..82e7acf3 100644 --- a/expat/lib/xmltok.c +++ b/expat/lib/xmltok.c @@ -412,7 +412,7 @@ utf8_toUtf8(const ENCODING *UNUSED_P(enc), } const ptrdiff_t bytesToCopy = fromLim - *fromP; - memcpy((void *)*toP, (const void *)*fromP, (size_t)bytesToCopy); + memcpy(*toP, *fromP, bytesToCopy); *fromP += bytesToCopy; *toP += bytesToCopy;