summaryrefslogtreecommitdiff
path: root/usr.bin/login/login.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1996-11-09 07:43:23 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1996-11-09 07:43:23 +0000
commitced0b5a8816f36704af6536b97aa639ec35b6c27 (patch)
tree503ed6495c997fa90806826d1e76c159e09a894a /usr.bin/login/login.c
parentcbc1c9d824017dd5559f7c811d4c26e24a1b27e3 (diff)
Ensure that username is initialized to NULL.
Diffstat (limited to 'usr.bin/login/login.c')
-rw-r--r--usr.bin/login/login.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c
index 007d05d4878..b89b444799c 100644
--- a/usr.bin/login/login.c
+++ b/usr.bin/login/login.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: login.c,v 1.11 1996/11/09 06:39:41 millert Exp $ */
+/* $OpenBSD: login.c,v 1.12 1996/11/09 07:43:22 millert Exp $ */
/* $NetBSD: login.c,v 1.13 1996/05/15 23:50:16 jtc Exp $ */
/*-
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)login.c 8.4 (Berkeley) 4/2/94";
#endif
-static char rcsid[] = "$OpenBSD: login.c,v 1.11 1996/11/09 06:39:41 millert Exp $";
+static char rcsid[] = "$OpenBSD: login.c,v 1.12 1996/11/09 07:43:22 millert Exp $";
#endif /* not lint */
/*
@@ -115,7 +115,7 @@ int authok;
struct passwd *pwd;
int failures;
-char term[64], *envinit[1], *hostname, *username, *tty;
+char term[64], *envinit[1], *hostname, *tty, *username = NULL;
int
main(argc, argv)
@@ -198,7 +198,7 @@ main(argc, argv)
(void)snprintf(tname, sizeof(tname), "%s??", _PATH_TTY);
ttyn = tname;
}
- if (tty = strrchr(ttyn, '/'))
+ if ((tty = strrchr(ttyn, '/')))
++tty;
else
tty = ttyn;
@@ -243,7 +243,7 @@ main(argc, argv)
}
(void)strcpy(tbuf, username);
- if (pwd = getpwnam(username))
+ if ((pwd = getpwnam(username)))
salt = pwd->pw_passwd;
else
salt = "xx";