diff options
author | ache <ache@FreeBSD.org> | 1997-03-03 08:11:28 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1997-03-03 08:11:28 +0000 |
commit | 681c062a9104a067b8b6d52d4c8f277dda632be4 (patch) | |
tree | 355920094252eb810f047f7327ea02df9d9d1ccc /lib | |
parent | cb0b007ac148c8ed8e6d56f1bb3eeff17f268321 (diff) | |
download | FreeBSD-src-681c062a9104a067b8b6d52d4c8f277dda632be4.zip FreeBSD-src-681c062a9104a067b8b6d52d4c8f277dda632be4.tar.gz |
Don't add/subtract 1 to MAXLOGNAME, it is already NUL-terminated
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/gen/getlogin.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/getlogin.c b/lib/libc/gen/getlogin.c index b6f55a4..5829539 100644 --- a/lib/libc/gen/getlogin.c +++ b/lib/libc/gen/getlogin.c @@ -47,10 +47,10 @@ int _logname_valid; /* known to setlogin() */ char * getlogin() { - static char logname[MAXLOGNAME + 1]; + static char logname[MAXLOGNAME]; if (_logname_valid == 0) { - if (_getlogin(logname, sizeof(logname) - 1) < 0) + if (_getlogin(logname, sizeof(logname)) < 0) return ((char *)NULL); _logname_valid = 1; } |