From 95bd487303a3a54317ff0e05fad7a9bb349d8f7d Mon Sep 17 00:00:00 2001 From: guenther Date: Sat, 14 Nov 2009 02:20:43 +0000 Subject: Use getopt() to parse the argument list, shrinking the code and permitting options to be grouped ok deraadt@ --- games/bs/bs.c | 72 ++++++++++++++++++++++++----------------------------------- 1 file changed, 29 insertions(+), 43 deletions(-) (limited to 'games/bs') diff --git a/games/bs/bs.c b/games/bs/bs.c index abf2708c28d..dc7a83b50b0 100644 --- a/games/bs/bs.c +++ b/games/bs/bs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bs.c,v 1.22 2009/10/27 23:59:24 deraadt Exp $ */ +/* $OpenBSD: bs.c,v 1.23 2009/11/14 02:20:43 guenther Exp $ */ /* * Copyright (c) 1986, Bruce Holloway * All rights reserved. @@ -1290,53 +1290,39 @@ void usage() static void do_options(int c, char *op[]) { - int i; + int ch; - if (c > 1) - { - for (i=1; i