summaryrefslogtreecommitdiffstats
path: root/regress/lib/libpthread/switch/switch.c
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2003-12-23 20:09:42 +0000
committermiod <miod@openbsd.org>2003-12-23 20:09:42 +0000
commit06cf2034ac0f3291c79f6ac69724ddbcefcda503 (patch)
treea919807ab698460d143c9096a7e3d3a5dffaf845 /regress/lib/libpthread/switch/switch.c
parentBased upon a freebsd change: (diff)
downloadwireguard-openbsd-06cf2034ac0f3291c79f6ac69724ddbcefcda503.tar.xz
wireguard-openbsd-06cf2034ac0f3291c79f6ac69724ddbcefcda503.zip
Use getopt(3) correctly.
Diffstat (limited to 'regress/lib/libpthread/switch/switch.c')
-rw-r--r--regress/lib/libpthread/switch/switch.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/regress/lib/libpthread/switch/switch.c b/regress/lib/libpthread/switch/switch.c
index f90e9bdca8a..5352bde20ca 100644
--- a/regress/lib/libpthread/switch/switch.c
+++ b/regress/lib/libpthread/switch/switch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: switch.c,v 1.4 2003/07/31 21:48:07 deraadt Exp $ */
+/* $OpenBSD: switch.c,v 1.5 2003/12/23 20:09:42 miod Exp $ */
/*
* Copyright (c) 1993, 1994, 1995, 1996 by Chris Provenzano and contributors,
* proven@mit.edu All rights reserved.
@@ -86,20 +86,16 @@ int
main(int argc, char *argv[])
{
pthread_t thread;
- int count = 4;
- int eof = 0;
+ int ch, count = 4;
long i;
/* Getopt variables. */
extern int optind, opterr;
extern char *optarg;
- while (!eof)
- switch (getopt (argc, argv, "c:d?"))
+ while ((ch = getopt(argc, argv, "c:?")) != -1)
+ switch (ch)
{
- case EOF:
- eof = 1;
- break;
case 'c':
count = atoi(optarg);
if ((count > 26) || (count < 2)) {