From 552d265b6ced1e56d31f20f16a7fe9ae818d568b Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 15 Jan 1997 23:44:39 +0000 Subject: getopt(3) returns -1 when out of args, not EOF, whee! --- usr.bin/tr/tr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.bin/tr') diff --git a/usr.bin/tr/tr.c b/usr.bin/tr/tr.c index 74af9024d05..4c089fe7c32 100644 --- a/usr.bin/tr/tr.c +++ b/usr.bin/tr/tr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tr.c,v 1.2 1996/06/26 05:41:51 deraadt Exp $ */ +/* $OpenBSD: tr.c,v 1.3 1997/01/15 23:43:24 millert Exp $ */ /* $NetBSD: tr.c,v 1.5 1995/08/31 22:13:48 jtc Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)tr.c 8.2 (Berkeley) 5/4/95"; #endif -static char rcsid[] = "$OpenBSD: tr.c,v 1.2 1996/06/26 05:41:51 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: tr.c,v 1.3 1997/01/15 23:43:24 millert Exp $"; #endif /* not lint */ #include @@ -106,7 +106,7 @@ main(argc, argv) int cflag, dflag, sflag, isstring2; cflag = dflag = sflag = 0; - while ((ch = getopt(argc, argv, "cds")) != EOF) + while ((ch = getopt(argc, argv, "cds")) != -1) switch((char)ch) { case 'c': cflag = 1; -- cgit v1.2.3