summaryrefslogtreecommitdiffstats
path: root/games/bs
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2015-09-27 05:27:42 +0000
committerguenther <guenther@openbsd.org>2015-09-27 05:27:42 +0000
commit3e07b96b1960a26beb8b3684625d104a5c4aa269 (patch)
tree7864de693449d8a91998d6d0f998764f5d56b0fb /games/bs
parentlint is dead: delete the trivial uses of /* VARARGS[0-9]+ */ (diff)
downloadwireguard-openbsd-3e07b96b1960a26beb8b3684625d104a5c4aa269.tar.xz
wireguard-openbsd-3e07b96b1960a26beb8b3684625d104a5c4aa269.zip
Make prompt() properly printf-like, eliminating empty dummy args
Diffstat (limited to 'games/bs')
-rw-r--r--games/bs/bs.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/games/bs/bs.c b/games/bs/bs.c
index f74d3ea0d22..517571af7be 100644
--- a/games/bs/bs.c
+++ b/games/bs/bs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bs.c,v 1.27 2015/02/18 23:41:31 tedu Exp $ */
+/* $OpenBSD: bs.c,v 1.28 2015/09/27 05:27:42 guenther Exp $ */
/*
* Copyright (c) 1986, Bruce Holloway
* All rights reserved.
@@ -296,13 +296,19 @@ static void intro(void)
#endif /* NCURSES_MOUSE_VERSION*/
}
-/* VARARGS1 */
-static void prompt(int n, char *f, char *s)
/* print a message at the prompt line */
+static void prompt(int, const char *, ...)
+ __attribute__((__format__ (printf, 2, 3)));
+static void
+prompt(int n, const char *f, ...)
{
+ va_list va;
+
(void) move(PROMPTLINE + n, 0);
(void) clrtoeol();
- (void) printw(f, s);
+ va_start(va, f);
+ (void) vw_printw(stdscr, f, va);
+ va_end(va);
(void) refresh();
}
@@ -500,7 +506,7 @@ regetchar:
ss->placed = TRUE;
break;
case 'R':
- prompt(1, "Placing the rest of your fleet at random...", "");
+ prompt(1, "Placing the rest of your fleet at random...");
for (ss = plyship; ss < plyship + SHIPTYPES; ss++)
if (!ss->placed)
{
@@ -556,7 +562,7 @@ regetchar:
(void) mvprintw(HYBASE+5, HXBASE,
" ");
- (void) prompt(0, "Press any key to start...", "");
+ (void) prompt(0, "Press any key to start...");
(void) getch();
}
@@ -842,13 +848,13 @@ static int plyturn(void)
int hit;
char *m = NULL;
- prompt(1, "Where do you want to shoot? ", "");
+ prompt(1, "Where do you want to shoot? ");
for (;;)
{
(void) getcoord(COMPUTER);
if (hits[PLAYER][curx][cury])
{
- prompt(1, "You shelled this spot already! Try again.", "");
+ prompt(1, "You shelled this spot already! Try again.");
beep();
}
else