]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
memzero.h: Remove no-op assignment
authorAlejandro Colomar <alx@kernel.org>
Mon, 31 Jul 2023 11:20:19 +0000 (13:20 +0200)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Fri, 1 Sep 2023 07:39:23 +0000 (09:39 +0200)
memset(3) returns the input pointer.  The assignment was effectively a
no-op, and just confused the code.

Cc: Christian Göttsche <cgzones@googlemail.com>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/memzero.h

index c81cd0ce27ce500f0fab9f0a1c7c799fb67aad03..cf2f70204ac2794a3157289ba2d87ab2c28a226f 100644 (file)
@@ -28,7 +28,7 @@ memzero(void *ptr, size_t size)
 #elif defined(HAVE_EXPLICIT_BZERO)
        explicit_bzero(ptr, size);
 #else
-       ptr = memset(ptr, '\0', size);
+       memset(ptr, '\0', size);
        __asm__ __volatile__ ("" : : "r"(ptr) : "memory");
 #endif
 }