diff options
author | bde <bde@FreeBSD.org> | 1999-05-27 12:58:41 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1999-05-27 12:58:41 +0000 |
commit | 5ef84c47be57379e422fabb986d98faaba91c4d5 (patch) | |
tree | 2f2780f8fdb2ebcb02668b2d27a7375869abc04b /usr.bin | |
parent | 5c5cd2fd9ee1fa5751f2ecf7616dc9d0b148019a (diff) | |
download | FreeBSD-src-5ef84c47be57379e422fabb986d98faaba91c4d5.zip FreeBSD-src-5ef84c47be57379e422fabb986d98faaba91c4d5.tar.gz |
Fixed usage message to almost match the man page. The old -d option and
the new -i option were missing.
Fixed style bugs in previous commit:
(1) initialisation of a local variable in its declaration.
(2) inconsistency of (1) with style of nearby code.
(3) disorder of declaration for (1).
(4) a line longer than 80 characters.
(5) bitrot in the printf() -> err() cleanups to help bloat the line in (4).
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/rlogin/rlogin.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/usr.bin/rlogin/rlogin.c b/usr.bin/rlogin/rlogin.c index 1af423d..fd8793b 100644 --- a/usr.bin/rlogin/rlogin.c +++ b/usr.bin/rlogin/rlogin.c @@ -40,7 +40,7 @@ static const char copyright[] = #ifndef lint static const char sccsid[] = "@(#)rlogin.c 8.1 (Berkeley) 6/6/93"; static const char rcsid[] = - "$Id: rlogin.c,v 1.18 1998/10/09 06:45:28 markm Exp $"; + "$Id: rlogin.c,v 1.19 1999/05/25 11:14:33 peter Exp $"; #endif /* not lint */ /* @@ -150,15 +150,14 @@ main(argc, argv) struct sgttyb ttyb; long omask; int argoff, ch, dflag, Dflag, one, uid; - char *host, *p, *user, term[1024]; + char *host, *localname, *p, *user, term[1024]; #ifdef KERBEROS char *k; #endif - char *localname = NULL; argoff = dflag = Dflag = 0; one = 1; - host = user = NULL; + host = localname = user = NULL; if ((p = rindex(argv[0], '/'))) ++p; @@ -206,10 +205,8 @@ main(argc, argv) escapechar = getescape(optarg); break; case 'i': - if (getuid() != 0) { - fprintf(stderr, "rlogin: -i user: permission denied\n"); - exit(1); - } + if (getuid() != 0) + errx(1, "-i user: permission denied"); localname = optarg; break; #ifdef KERBEROS @@ -869,15 +866,15 @@ void usage() { (void)fprintf(stderr, - "usage: rlogin [ -%s]%s[-e char] [ -l username ] host\n", + "usage: rlogin [-%s]%s[-e char] [-i localname] [-l username] host\n", #ifdef KERBEROS #ifdef CRYPT - "8DEKLx", " [-k realm] "); + "8DEKLdx", " [-k realm] "); #else - "8DEKL", " [-k realm] "); + "8DEKLd", " [-k realm] "); #endif #else - "8DEL", " "); + "8DELd", " "); #endif exit(1); } |