summaryrefslogtreecommitdiff
path: root/usr.bin/write
diff options
context:
space:
mode:
authorBill Fumerola <billf@FreeBSD.org>1999-07-04 17:26:16 +0000
committerBill Fumerola <billf@FreeBSD.org>1999-07-04 17:26:16 +0000
commit9ef5c48befdfa36ad5ef5e0ae898e7ca9397abcc (patch)
treeb5a6ada1388aeb7553694b736fde6dc7d114dbff /usr.bin/write
parentadbaeacdd6ef7704c5427e2ed81c4364d91c6e07 (diff)
downloadsrc-test-9ef5c48befdfa36ad5ef5e0ae898e7ca9397abcc.tar.gz
src-test-9ef5c48befdfa36ad5ef5e0ae898e7ca9397abcc.zip
Clean up some ambiguous nested if/elses.
Notes
Notes: svn path=/head/; revision=48566
Diffstat (limited to 'usr.bin/write')
-rw-r--r--usr.bin/write/write.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/write/write.c b/usr.bin/write/write.c
index 908bda04491fb..f1a37fb6003a0 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)