summaryrefslogtreecommitdiff
path: root/games/fortune/unstr
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2014-11-16 04:49:50 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2014-11-16 04:49:50 +0000
commitf2273a76226705a4e8f5e015d1835449da4e3242 (patch)
tree9aa8ab3b6fae60c8e2a7a05923b9b6f239d3f864 /games/fortune/unstr
parent3243c629699c25f7f4a576fe1c2f58e274eba8f7 (diff)
Eliminate pointless use of <sys/param.h>, <sys/file.h>, <sys/sockio.h>,
and <sys/ttydefaults.h> Replace MAXPATHLEN with PATH_MAX and MAXLOGNAME with LOGIN_NAME_MAX Pull in <limits.h> where needed Prefer sizeof(var) over MAXFOO or FOO_MAX ok deraadt@
Diffstat (limited to 'games/fortune/unstr')
-rw-r--r--games/fortune/unstr/unstr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/games/fortune/unstr/unstr.c b/games/fortune/unstr/unstr.c
index c081ceb6209..43bcb645a54 100644
--- a/games/fortune/unstr/unstr.c
+++ b/games/fortune/unstr/unstr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: unstr.c,v 1.10 2009/10/27 23:59:24 deraadt Exp $ */
+/* $OpenBSD: unstr.c,v 1.11 2014/11/16 04:49:48 guenther Exp $ */
/* $NetBSD: unstr.c,v 1.3 1995/03/23 08:29:00 cgd Exp $ */
/*-
@@ -46,15 +46,15 @@
* Ken Arnold Aug 13, 1978
*/
-#include <sys/param.h>
#include <ctype.h>
#include <err.h>
+#include <limits.h>
#include <stdio.h>
#include <string.h>
#include "strfile.h"
char *Infile, /* name of input file */
- Datafile[MAXPATHLEN], /* name of data file */
+ Datafile[PATH_MAX], /* name of data file */
Delimch; /* delimiter character */
FILE *Inf, *Dataf;
@@ -97,7 +97,7 @@ getargs(char *av[])
}
Infile = *av;
(void) strlcpy(Datafile, Infile, sizeof(Datafile));
- if (strlcat(Datafile, ".dat", sizeof(Datafile)) >= MAXPATHLEN)
+ if (strlcat(Datafile, ".dat", sizeof(Datafile)) >= sizeof(Datafile))
errx(1, "`%s': filename too long", Infile);
}