From b643bb9badf4a995d989b8daf3e33ba8ee6ffda2 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 30 Jun 2000 16:00:30 +0000 Subject: 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). --- usr.bin/uniq/uniq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.bin/uniq') diff --git a/usr.bin/uniq/uniq.c b/usr.bin/uniq/uniq.c index 8e81fdde0ea..82c0cfa572d 100644 --- a/usr.bin/uniq/uniq.c +++ b/usr.bin/uniq/uniq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uniq.c,v 1.5 1997/07/25 22:21:40 mickey Exp $ */ +/* $OpenBSD: uniq.c,v 1.6 2000/06/30 16:00:22 millert Exp $ */ /* $NetBSD: uniq.c,v 1.7 1995/08/31 22:03:48 jtc Exp $ */ /* @@ -47,7 +47,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)uniq.c 8.3 (Berkeley) 5/4/95"; #endif -static char rcsid[] = "$OpenBSD: uniq.c,v 1.5 1997/07/25 22:21:40 mickey Exp $"; +static char rcsid[] = "$OpenBSD: uniq.c,v 1.6 2000/06/30 16:00:22 millert Exp $"; #endif /* not lint */ #include @@ -210,7 +210,7 @@ file(name, mode) FILE *fp; if ((fp = fopen(name, mode)) == NULL) - err(1, name); + err(1, "%s", name); return(fp); } -- cgit v1.2.3