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

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;