diff options
| author | christos <christos@NetBSD.org> | 2011-08-16 11:19:41 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2011-08-16 11:19:41 +0000 |
| commit | 56a2fcd7a5cdaf2ffeeec17dbee5ef82ee108f05 (patch) | |
| tree | 05f1965e38f6c7121209d630f7799e9cfacb8043 | |
| parent | fc21a0ee00da624c8f8f6721b908e91b4610f760 (diff) | |
eliminate/document non-literal format strings
| -rw-r--r-- | games/larn/Makefile | 5 | ||||
| -rw-r--r-- | games/larn/movem.c | 22 |
2 files changed, 14 insertions, 13 deletions
diff --git a/games/larn/Makefile b/games/larn/Makefile index 5facdacf922..cca697bbf28 100644 --- a/games/larn/Makefile +++ b/games/larn/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.20 2010/02/03 15:34:39 roy Exp $ +# $NetBSD: Makefile,v 1.21 2011/08/16 11:19:41 christos Exp $ # @(#)Makefile 5.12 (Berkeley) 5/30/93 # EXTRA @@ -74,4 +74,7 @@ FILES=${DAT:S@^@${.CURDIR}/datfiles/@g} FILESDIR=/usr/share/games/larn .endif +COPTS.display.c += -Wno-format-nonliteral +COPTS.monster.c += -Wno-format-nonliteral + .include <bsd.prog.mk> diff --git a/games/larn/movem.c b/games/larn/movem.c index 6625a18731e..81127dd7eca 100644 --- a/games/larn/movem.c +++ b/games/larn/movem.c @@ -1,4 +1,4 @@ -/* $NetBSD: movem.c,v 1.7 2009/08/12 08:04:05 dholland Exp $ */ +/* $NetBSD: movem.c,v 1.8 2011/08/16 11:19:41 christos Exp $ */ /* * movem.c (move monster) Larn is copyrighted 1986 by Noah Morgan. @@ -12,7 +12,7 @@ */ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: movem.c,v 1.7 2009/08/12 08:04:05 dholland Exp $"); +__RCSID("$NetBSD: movem.c,v 1.8 2011/08/16 11:19:41 christos Exp $"); #endif /* not lint */ #include "header.h" @@ -278,7 +278,7 @@ mmove(aa, bb, cc, dd) int aa, bb, cc, dd; { int tmp, i, flag; - const char *who = NULL, *p; + const char *who = NULL; flag = 0; /* set to 1 if monster hit by arrow trap */ if ((cc == playerx) && (dd == playery)) { @@ -364,24 +364,22 @@ mmove(aa, bb, cc, dd) if (c[BLINDCOUNT]) return; /* if blind don't show where monsters are */ if (know[cc][dd] & 1) { - p = 0; if (flag) cursors(); switch (flag) { case 1: - p = "\n%s hits the %s"; + lprintf("\n%s hits the %s", who, monster[tmp].name); + beep(); break; case 2: - p = "\n%s hits and kills the %s"; + lprintf("\n%s hits and kills the %s", + who, monster[tmp].name); + beep(); break; case 3: - p = "\nThe %s%s gets teleported"; - who = ""; - break; - }; - if (p) { - lprintf(p, who, monster[tmp].name); + lprintf("\nThe %s gets teleported", monster[tmp].name); beep(); + break; } } /* |
