diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-01-18 04:57:56 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-01-18 04:57:56 +0000 |
commit | a069d26bc905dbf6dabe64efaa1404e6f08ad73a (patch) | |
tree | 96286fd1dbcb70e3cbc98240c816638ec78a72a8 | |
parent | b7998f506ae772f6b004ef6fa6918a918d99dd03 (diff) |
Use err, not errx when freopen() failes to get error string; form@openbsd.org
Also, since the file may be user-supplied, don't just pass it as the first
arg to errx() since it could have printf-style escapes in it.
-rw-r--r-- | usr.bin/from/from.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/from/from.c b/usr.bin/from/from.c index 7a79c228ff7..b914edfcd8f 100644 --- a/usr.bin/from/from.c +++ b/usr.bin/from/from.c @@ -1,4 +1,4 @@ -/* $OpenBSD: from.c,v 1.5 1999/08/26 14:17:20 aaron Exp $ */ +/* $OpenBSD: from.c,v 1.6 2000/01/18 04:57:55 millert Exp $ */ /* $NetBSD: from.c,v 1.6 1995/09/01 01:39:10 jtc Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)from.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: from.c,v 1.5 1999/08/26 14:17:20 aaron Exp $"; +static char rcsid[] = "$OpenBSD: from.c,v 1.6 2000/01/18 04:57:55 millert Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -118,7 +118,7 @@ main(argc, argv) } } if (!freopen(file, "r", stdin)) - errx(1, file); + err(1, "%s", file); for (newline = 1; fgets(buf, sizeof(buf), stdin);) { if (*buf == '\n') { newline = 1; |