summaryrefslogtreecommitdiffstats
path: root/usr.bin/finger
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-03-01 05:52:38 +0000
committerimp <imp@FreeBSD.org>2001-03-01 05:52:38 +0000
commit83cfdca42cb29d105549ba9032dc486451705f81 (patch)
tree4ccc3826b6f91db1d1b441dec93d642d11120649 /usr.bin/finger
parent4fa94267e206cb568bfb157c491d77fee5e6047d (diff)
downloadFreeBSD-src-83cfdca42cb29d105549ba9032dc486451705f81.zip
FreeBSD-src-83cfdca42cb29d105549ba9032dc486451705f81.tar.gz
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.
Diffstat (limited to 'usr.bin/finger')
-rw-r--r--usr.bin/finger/util.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/usr.bin/finger/util.c b/usr.bin/finger/util.c
index 19e2f96..2efa310 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;
OpenPOWER on IntegriCloud