contrib, lib/, src/, tests/: Use stpcpy(3) instead of its pattern
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Serge Hallyn
parent
c6018240f8
commit
59e5eef38f
+2
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user