diff options
author | billf <billf@FreeBSD.org> | 1999-07-04 17:26:16 +0000 |
---|---|---|
committer | billf <billf@FreeBSD.org> | 1999-07-04 17:26:16 +0000 |
commit | 4822432874e997891c75df8d30dcab4c52d1a9fa (patch) | |
tree | 6a75551fe39c6d09c4b5991bbb0a4f3d685835fe /usr.bin/write | |
parent | 7c7c72da3801ba6f43e728ff5145b4988674abeb (diff) | |
download | FreeBSD-src-4822432874e997891c75df8d30dcab4c52d1a9fa.zip FreeBSD-src-4822432874e997891c75df8d30dcab4c52d1a9fa.tar.gz |
Clean up some ambiguous nested if/elses.
Diffstat (limited to 'usr.bin/write')
-rw-r--r-- | usr.bin/write/write.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/write/write.c b/usr.bin/write/write.c index 908bda0..f1a37fb 100644 --- a/usr.bin/write/write.c +++ b/usr.bin/write/write.c @@ -45,7 +45,7 @@ static const char copyright[] = static char sccsid[] = "@(#)write.c 8.1 (Berkeley) 6/6/93"; #endif static const char rcsid[] = - "$Id: write.c,v 1.9 1997/09/15 00:17:38 ache Exp $"; + "$Id: write.c,v 1.10 1997/09/15 00:40:34 ache Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -259,11 +259,12 @@ do_write(tty, mytty, myuid) char path[MAXPATHLEN], host[MAXHOSTNAMELEN], line[512]; /* Determine our login name before the we reopen() stdout */ - if ((login = getlogin()) == NULL) + if ((login = getlogin()) == NULL) { if ((pwd = getpwuid(myuid))) login = pwd->pw_name; else login = "???"; + } (void)snprintf(path, sizeof(path), "%s%s", _PATH_DEV, tty); if ((freopen(path, "w", stdout)) == NULL) |