]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Prefer strcpy(3) to strlcpy(3) when either works
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 11 Mar 2023 08:02:45 +0000 (00:02 -0800)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Tue, 28 Mar 2023 11:00:38 +0000 (13:00 +0200)
* lib/gshadow.c (sgetsgent): Use strcpy(3) not strlcpy(3),
since the string is known to fit.

Signed-off-by: Paul Eggert <eggert@cs.ucla.edu>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
lib/gshadow.c

index c17af67fdf4d5a8c635597a5f4dc56230e1892e4..ca14449ac70cb3b38cad62f688cc2c280a47e6db 100644 (file)
@@ -128,7 +128,7 @@ void endsgent (void)
                sgrbuflen = len;
        }
 
-       strlcpy (sgrbuf, string, len);
+       strcpy (sgrbuf, string);
 
        cp = strrchr (sgrbuf, '\n');
        if (NULL != cp) {