summaryrefslogtreecommitdiff
path: root/games/monop/execute.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2000-06-30 16:00:30 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2000-06-30 16:00:30 +0000
commitb643bb9badf4a995d989b8daf3e33ba8ee6ffda2 (patch)
tree87720e8aa60a5b4230d0072dfd2b3d422d7dd1cd /games/monop/execute.c
parent46239127052c30fac93140fbe021cdd151fdac8a (diff)
warnx?/errx? paranoia (use "%s" not a bare string unless it is a
constant). These are not security holes but it is worth fixing them anyway both for robustness and so folks looking for examples in the tree are not misled into doing something potentially dangerous. Furthermore, it is a bad idea to assume that pathnames will not include '%' in them and that error routines don't return strings with '%' in them (especially in light of the possibility of locales).
Diffstat (limited to 'games/monop/execute.c')
-rw-r--r--games/monop/execute.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/games/monop/execute.c b/games/monop/execute.c
index 770942efa0e..9e9b5e332f2 100644
--- a/games/monop/execute.c
+++ b/games/monop/execute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: execute.c,v 1.3 1998/11/29 19:45:11 pjanzen Exp $ */
+/* $OpenBSD: execute.c,v 1.4 2000/06/30 16:00:04 millert Exp $ */
/* $NetBSD: execute.c,v 1.3 1995/03/23 08:34:38 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)execute.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: execute.c,v 1.3 1998/11/29 19:45:11 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: execute.c,v 1.4 2000/06/30 16:00:04 millert Exp $";
#endif
#endif /* not lint */
@@ -220,7 +220,7 @@ save()
return;
if ((outf=creat(buf, 0644)) < 0) {
- warn(buf);
+ warn("%s", buf);
return;
}
printf("\"%s\" ", buf);
@@ -267,12 +267,12 @@ rest_f(file)
STAT sbuf;
if ((inf = open(file, O_RDONLY)) < 0) {
- warn(file);
+ warn("%s", file);
return FALSE;
}
printf("\"%s\" ", file);
if (fstat(inf, &sbuf) < 0) /* get file stats */
- err(1, file);
+ err(1, "%s", file);
#if 0
start = (((int) etext + (SEGSIZE-1)) / SEGSIZE ) * SEGSIZE;
#else