From: jkatz Date: Sat, 1 Feb 1997 19:38:26 +0000 (+0000) Subject: Catches luser/typo when "@" is the first character of first argument X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=37055eb141af4f57988cbd59117d0f4a8e89c9d2;p=openbsd Catches luser/typo when "@" is the first character of first argument --- 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 @@ -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;