aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorGuido van Rooij <guido@FreeBSD.org>1996-07-14 16:42:33 +0000
committerGuido van Rooij <guido@FreeBSD.org>1996-07-14 16:42:33 +0000
commit72383443f2d694aefaeaa9e54480b4245caf7acb (patch)
treeb6933fb03c1f839d2c4d34a52d82ccf05595feed /usr.bin
parentfb547ee202d80efd098db5e0f83a1a93bbdb1fe1 (diff)
downloadsrc-72383443f2d694aefaeaa9e54480b4245caf7acb.tar.gz
src-72383443f2d694aefaeaa9e54480b4245caf7acb.zip
Move setting of username to the correcft place; also initialize it.
Reviewed by: peter@freebsd.org
Notes
Notes: svn path=/head/; revision=17169
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/chpass/chpass.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/chpass/chpass.c b/usr.bin/chpass/chpass.c
index 83d54983f3f7..9a7b8a67f85f 100644
--- a/usr.bin/chpass/chpass.c
+++ b/usr.bin/chpass/chpass.c
@@ -40,7 +40,7 @@ static char copyright[] =
#ifndef lint
static char sccsid[] = "From: @(#)chpass.c 8.4 (Berkeley) 4/2/94";
static char rcsid[] =
- "$Id: chpass.c,v 1.8 1996/05/25 01:05:17 wpaul Exp $";
+ "$Id: chpass.c,v 1.9 1996/07/01 19:38:07 guido Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -84,7 +84,7 @@ main(argc, argv)
{
enum { NEWSH, LOADENTRY, EDITENTRY, NEWPW } op;
struct passwd *pw, lpw;
- char *username;
+ char *username = NULL;
int ch, pfd, tfd;
char *arg;
#ifdef YP
@@ -181,7 +181,6 @@ main(argc, argv)
default:
usage();
}
- username = pw->pw_name;
if (op == NEWSH) {
/* protect p_shell -- it thinks NULL is /bin/sh */
if (!arg[0])
@@ -197,6 +196,7 @@ main(argc, argv)
if (!pw_scan(arg, pw))
exit(1);
}
+ username = pw->pw_name;
if (op == NEWPW) {
if (uid)