summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorjkatz <jkatz@cvs.openbsd.org>1997-02-01 19:38:27 +0000
committerjkatz <jkatz@cvs.openbsd.org>1997-02-01 19:38:27 +0000
commit998c24fd49bf037839de2531c724d288460c20f8 (patch)
treec46e1a2705f2d82308593eee4c96596cffd66aec /usr.bin
parent9c0b05d5a19d9a7acc20d2f06b4f4d2489937918 (diff)
Catches luser/typo when "@" is the first character of first argument
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/talk/get_names.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/talk/get_names.c b/usr.bin/talk/get_names.c
index f4c0e8efb2b..b0b05c4cfcb 100644
--- a/usr.bin/talk/get_names.c
+++ b/usr.bin/talk/get_names.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: get_names.c,v 1.3 1997/01/17 07:13:28 millert Exp $ */
+/* $OpenBSD: get_names.c,v 1.4 1997/02/01 19:38:26 jkatz Exp $ */
/* $NetBSD: get_names.c,v 1.4 1994/12/09 02:14:16 jtc Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)get_names.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: get_names.c,v 1.3 1997/01/17 07:13:28 millert Exp $";
+static char rcsid[] = "$OpenBSD: get_names.c,v 1.4 1997/02/01 19:38:26 jkatz Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -68,12 +68,20 @@ get_names(argc, argv)
if (argc < 2 ) {
printf("Usage: talk user [ttyname]\n");
+ printf(" talk user@hostname [ttyname]\n");
exit(-1);
}
if (!isatty(0)) {
printf("Standard input must be a tty, not a pipe or a file\n");
exit(-1);
}
+
+ if ('@' == argv[1][0]) {
+ printf("Usage: talk user [ttyname]\n");
+ printf(" talk user@hostname [ttyname]\n");
+ exit(-1);
+ }
+
if ((my_name = getlogin()) == NULL) {
struct passwd *pw;