Module Name:    src
Committed By:   christos
Date:           Tue Aug 16 11:19:41 UTC 2011

Modified Files:
        src/games/larn: Makefile movem.c

Log Message:
eliminate/document non-literal format strings


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/games/larn/Makefile
cvs rdiff -u -r1.7 -r1.8 src/games/larn/movem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/larn/Makefile
diff -u src/games/larn/Makefile:1.20 src/games/larn/Makefile:1.21
--- src/games/larn/Makefile:1.20	Wed Feb  3 10:34:39 2010
+++ src/games/larn/Makefile	Tue Aug 16 07:19:41 2011
@@ -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 @@
 FILESDIR=/usr/share/games/larn
 .endif
 
+COPTS.display.c += -Wno-format-nonliteral
+COPTS.monster.c += -Wno-format-nonliteral
+
 .include <bsd.prog.mk>

Index: src/games/larn/movem.c
diff -u src/games/larn/movem.c:1.7 src/games/larn/movem.c:1.8
--- src/games/larn/movem.c:1.7	Wed Aug 12 04:04:05 2009
+++ src/games/larn/movem.c	Tue Aug 16 07:19:41 2011
@@ -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 @@
 	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 @@
 	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;
 		}
 	}
 	/*

Reply via email to