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/id/id.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.bin/id') diff --git a/usr.bin/id/id.c b/usr.bin/id/id.c index 4696ef799c7..1586254719e 100644 --- a/usr.bin/id/id.c +++ b/usr.bin/id/id.c @@ -1,4 +1,4 @@ -/* $OpenBSD: id.c,v 1.2 1996/06/26 05:34:24 deraadt Exp $ */ +/* $OpenBSD: id.c,v 1.3 1997/01/15 23:42:35 millert Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -41,7 +41,7 @@ static char copyright[] = #ifndef lint /*static char sccsid[] = "@(#)id.c 8.3 (Berkeley) 4/28/95";*/ -static char rcsid[] = "$OpenBSD: id.c,v 1.2 1996/06/26 05:34:24 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: id.c,v 1.3 1997/01/15 23:42:35 millert Exp $"; #endif /* not lint */ #include @@ -73,7 +73,7 @@ main(argc, argv) int Gflag, ch, gflag, id, nflag, pflag, rflag, uflag; Gflag = gflag = nflag = pflag = rflag = uflag = 0; - while ((ch = getopt(argc, argv, "Ggnpru")) != EOF) + while ((ch = getopt(argc, argv, "Ggnpru")) != -1) switch(ch) { case 'G': Gflag = 1; -- cgit v1.2.3