diff options
author | Warner Losh <imp@FreeBSD.org> | 2001-03-01 05:52:38 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2001-03-01 05:52:38 +0000 |
commit | 167ea27b4f46e91e0c6d52f55722965cee5acdf4 (patch) | |
tree | 9eaa397fa353513d63f8792cac4faf9ad49383d3 /usr.bin/finger | |
parent | 5bf6254172484b982976f3fce85be0262180421a (diff) | |
download | src-167ea27b4f46e91e0c6d52f55722965cee5acdf4.tar.gz src-167ea27b4f46e91e0c6d52f55722965cee5acdf4.zip |
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.
Notes
Notes:
svn path=/head/; revision=73260
Diffstat (limited to 'usr.bin/finger')
-rw-r--r-- | usr.bin/finger/util.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/usr.bin/finger/util.c b/usr.bin/finger/util.c index 19e2f96d9d9d..2efa310972ea 100644 --- a/usr.bin/finger/util.c +++ b/usr.bin/finger/util.c @@ -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; |