-/* $NetBSD: getinp.c,v 1.7 1999/08/21 10:40:03 simonb Exp $ */
+/* $NetBSD: getinp.c,v 1.9 2000/07/10 10:19:26 itojun Exp $ */
/*
* Copyright (c) 1980, 1993
#if 0
static char sccsid[] = "@(#)getinp.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: getinp.c,v 1.7 1999/08/21 10:40:03 simonb Exp $");
+__RCSID("$NetBSD: getinp.c,v 1.9 2000/07/10 10:19:26 itojun Exp $");
#endif
#endif /* not lint */
static char buf[257];
-static int comp __P((char *));
+static int comp __P((const char *));
int
getinp(prompt, list)
- char *prompt, *list[];
+ const char *prompt, *const list[];
{
int i, n_match, match = 0;
char *sp;
for (;;) {
inter:
- printf(prompt);
+ printf("%s", prompt);
for (sp = buf; (c=getchar()) != '\n'; ) {
*sp = c;
if (c == -1) /* check for interupted system call */
printf("<RETURN>");
}
else
- printf(list[i]);
+ printf("%s", list[i]);
if (list[i+1])
printf(", ");
else
static int
comp(s1)
- char *s1;
+ const char *s1;
{
- char *sp, *tsp, c;
+ const char *sp, *tsp;
+ char c;
if (buf[0] != '\0')
for (sp = buf, tsp = s1; *sp; ) {