1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-02 08:42:48 +00:00

MAXPATHLEN is enough.

Also, snprinf is guaranteed by the new ansi standard to NUL terminate the
string, so we don't need to do that ourselves.
This commit is contained in:
Warner Losh 2001-03-01 05:52:38 +00:00
parent 5bf6254172
commit 167ea27b4f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=73260

View File

@ -411,13 +411,12 @@ int
hide(pw)
struct passwd *pw;
{
char buf[MAXPATHLEN+1];
char buf[MAXPATHLEN];
if (!pw->pw_dir)
return 0;
snprintf(buf, sizeof(buf), "%s/.nofinger", pw->pw_dir);
buf[sizeof(buf) - 1] = '\0';
if (access(buf, F_OK) == 0)
return 1;