summaryrefslogtreecommitdiffstats
path: root/monop/getinp.c
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2008-01-28 06:16:13 +0000
committerdholland <dholland@NetBSD.org>2008-01-28 06:16:13 +0000
commitd9e06af0170971fa7c14eddc67a9b07fafea7dde (patch)
tree77227527f3289a28b25db878cc4a60f370321adb /monop/getinp.c
parent41058b6ea0386b49a8c5d57d215a75e6230d9cab (diff)
downloadbsdgames-darwin-d9e06af0170971fa7c14eddc67a9b07fafea7dde.tar.gz
bsdgames-darwin-d9e06af0170971fa7c14eddc67a9b07fafea7dde.tar.zst
bsdgames-darwin-d9e06af0170971fa7c14eddc67a9b07fafea7dde.zip
Make this build with WARNS=4.
Diffstat (limited to 'monop/getinp.c')
-rw-r--r--monop/getinp.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/monop/getinp.c b/monop/getinp.c
index cd0253c9..2166b9fa 100644
--- a/monop/getinp.c
+++ b/monop/getinp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: getinp.c,v 1.14 2006/01/20 21:40:08 elad Exp $ */
+/* $NetBSD: getinp.c,v 1.15 2008/01/28 06:16:13 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)getinp.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: getinp.c,v 1.14 2006/01/20 21:40:08 elad Exp $");
+__RCSID("$NetBSD: getinp.c,v 1.15 2008/01/28 06:16:13 dholland Exp $");
#endif
#endif /* not lint */
@@ -50,8 +50,8 @@ static char buf[257];
static int comp(const char *);
int
-getinp(prompt, list)
- const char *prompt, *const list[];
+getinp(prompt, lst)
+ const char *prompt, *const lst[];
{
int i, n_match, match = 0;
char *sp;
@@ -69,18 +69,18 @@ getinp(prompt, list)
*sp = c;
if (buf[0] == '?' && buf[1] == '\n') {
printf("Valid inputs are: ");
- for (i = 0, match = 18; list[i]; i++) {
- if ((match+=(n_match=strlen(list[i]))) > LINE) {
+ for (i = 0, match = 18; lst[i]; i++) {
+ if ((match+=(n_match=strlen(lst[i]))) > LINE) {
printf("\n\t");
match = n_match + 8;
}
- if (*list[i] == '\0') {
+ if (*lst[i] == '\0') {
match += 8;
printf("<RETURN>");
}
else
- printf("%s", list[i]);
- if (list[i+1])
+ printf("%s", lst[i]);
+ if (lst[i+1])
printf(", ");
else
putchar('\n');
@@ -91,8 +91,8 @@ getinp(prompt, list)
*sp = '\0';
for (sp = buf; *sp; sp++)
*sp = tolower((unsigned char)*sp);
- for (i = n_match = 0; list[i]; i++)
- if (comp(list[i])) {
+ for (i = n_match = 0; lst[i]; i++)
+ if (comp(lst[i])) {
n_match++;
match = i;
}