summaryrefslogtreecommitdiff
path: root/games/hack/hack.main.c
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2015-09-27 05:13:12 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2015-09-27 05:13:12 +0000
commit09d35c95ce0ff1594c9bf50b447c1886edffe109 (patch)
treecf9cd951b0ed3f02fa6c13f7ad8cb3981d04a14a /games/hack/hack.main.c
parent4b3f84711e25bb946b5c023faf89a43fbb194bd7 (diff)
Annotate funcs with __attribute__((printf(...))) and clean up the fallout:
* lots of foo(str) --> foo("%s", str) transformations * one totally insane foo(fmt, ap) --> vfoo(fmt, ap) conversion: how did this ever work? * prefer const char[] over char* for static format strings, as it lets gcc check the format and eliminates an unnecessary pointer ok beck@
Diffstat (limited to 'games/hack/hack.main.c')
-rw-r--r--games/hack/hack.main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/games/hack/hack.main.c b/games/hack/hack.main.c
index 045d4e9cc61..a70659981a2 100644
--- a/games/hack/hack.main.c
+++ b/games/hack/hack.main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hack.main.c,v 1.16 2014/12/08 21:56:27 deraadt Exp $ */
+/* $OpenBSD: hack.main.c,v 1.17 2015/09/27 05:13:11 guenther Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -403,7 +403,7 @@ not_recovered:
}
if(multi < 0) {
if(!++multi){
- pline(nomovemsg ? nomovemsg :
+ pline("%s", nomovemsg ? nomovemsg :
"You can move again.");
nomovemsg = 0;
if(afternmv) (*afternmv)();
@@ -500,12 +500,12 @@ askname()
}
void
-impossible(char *s, ...)
+impossible(const char *s, ...)
{
va_list ap;
va_start(ap, s);
- pline(s, ap);
+ vpline(s, ap);
va_end(ap);
pline("Program in disorder - perhaps you'd better Quit.");
}