contrib, lib/, src/, tests/: Use stpcpy(3) instead of its pattern

Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar
2024-07-03 10:03:12 -05:00
committed by Serge Hallyn
parent c6018240f8
commit 59e5eef38f
34 changed files with 104 additions and 132 deletions
+2 -2
View File
@@ -77,7 +77,7 @@ static struct spwd *my_sgetspent (const char *string)
if (strlen (string) >= sizeof spwbuf)
return 0;
strcpy (spwbuf, string);
*strchrnul(spwbuf, '\n') = '\0';
stpcpy(strchrnul(spwbuf, '\n'), "");
/*
* Tokenize the string into colon separated fields. Allow up to
@@ -202,7 +202,7 @@ struct spwd *fgetspent (FILE * fp)
if (fgets (buf, sizeof buf, fp) != NULL)
{
*strchrnul(buf, '\n') = '\0';
stpcpy(strchrnul(buf, '\n'), "");
return my_sgetspent (buf);
}
return 0;