From ea3d49506fb144348be10eba6f6fe1250b875a48 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 11 Mar 2023 00:02:45 -0800 Subject: [PATCH] Prefer strcpy(3) to strlcpy(3) when either works * lib/gshadow.c (sgetsgent): Use strcpy(3) not strlcpy(3), since the string is known to fit. Signed-off-by: Paul Eggert Signed-off-by: Alejandro Colomar Reviewed-by: Iker Pedrosa --- lib/gshadow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gshadow.c b/lib/gshadow.c index c17af67f..ca14449a 100644 --- a/lib/gshadow.c +++ b/lib/gshadow.c @@ -128,7 +128,7 @@ void endsgent (void) sgrbuflen = len; } - strlcpy (sgrbuf, string, len); + strcpy (sgrbuf, string); cp = strrchr (sgrbuf, '\n'); if (NULL != cp) {