Module Name:    src
Committed By:   dholland
Date:           Mon May 25 00:43:34 UTC 2009

Modified Files:
        src/games/trek: getpar.c shield.c

Log Message:
sprintf -> snprintf.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/games/trek/getpar.c
cvs rdiff -u -r1.11 -r1.12 src/games/trek/shield.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/trek/getpar.c
diff -u src/games/trek/getpar.c:1.16 src/games/trek/getpar.c:1.17
--- src/games/trek/getpar.c:1.16	Mon May 25 00:39:45 2009
+++ src/games/trek/getpar.c	Mon May 25 00:43:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: getpar.c,v 1.16 2009/05/25 00:39:45 dholland Exp $	*/
+/*	$NetBSD: getpar.c,v 1.17 2009/05/25 00:43:34 dholland Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)getpar.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: getpar.c,v 1.16 2009/05/25 00:39:45 dholland Exp $");
+__RCSID("$NetBSD: getpar.c,v 1.17 2009/05/25 00:43:34 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -197,7 +197,7 @@
 
 	if (t == 0)
 		t = " \t\n;";
-	(void)sprintf(format, "%%%d[^%s]", l, t);
+	(void)snprintf(format, sizeof(format), "%%%d[^%s]", l, t);
 	while (1) {
 		if ((f = testnl()) && s)
 			printf("%s: ", s);

Index: src/games/trek/shield.c
diff -u src/games/trek/shield.c:1.11 src/games/trek/shield.c:1.12
--- src/games/trek/shield.c:1.11	Sun May 24 22:55:03 2009
+++ src/games/trek/shield.c	Mon May 25 00:43:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: shield.c,v 1.11 2009/05/24 22:55:03 dholland Exp $	*/
+/*	$NetBSD: shield.c,v 1.12 2009/05/25 00:43:34 dholland Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)shield.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: shield.c,v 1.11 2009/05/24 22:55:03 dholland Exp $");
+__RCSID("$NetBSD: shield.c,v 1.12 2009/05/25 00:43:34 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -111,10 +111,12 @@
 		i = (long) r->value;
 	} else {
 		if (*stat)
-			(void)sprintf(s, "%s %s up.  Do you want %s down",
+			(void)snprintf(s, sizeof(s),
+				"%s %s up.  Do you want %s down",
 				device, dev2, dev3);
 		else
-			(void)sprintf(s, "%s %s down.  Do you want %s up",
+			(void)snprintf(s, sizeof(s),
+				"%s %s down.  Do you want %s up",
 				device, dev2, dev3);
 		if (!getynpar(s))
 			return;

Reply via email to