summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2001-03-09 00:38:47 +0000
committerderaadt <deraadt@openbsd.org>2001-03-09 00:38:47 +0000
commitf082c49092159853c408a828f8570bde7e10b074 (patch)
tree415235b705d3eeaf75c2e027e28ba7e3814119ae
parentTalk a little more about the differences between PPPoE on FreeBSD & OpenBSD. (diff)
downloadwireguard-openbsd-f082c49092159853c408a828f8570bde7e10b074.tar.xz
wireguard-openbsd-f082c49092159853c408a828f8570bde7e10b074.zip
PATH_MAX includes NUL
-rw-r--r--usr.sbin/gspa/gspa/gspa.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.sbin/gspa/gspa/gspa.c b/usr.sbin/gspa/gspa/gspa.c
index 917190713eb..23e3171b4af 100644
--- a/usr.sbin/gspa/gspa/gspa.c
+++ b/usr.sbin/gspa/gspa/gspa.c
@@ -61,7 +61,7 @@ FILE *current_infile;
FILE *objfile;
FILE *listfile;
-char in_name[PATH_MAX + 1];
+char in_name[PATH_MAX];
struct input {
FILE *fp;
@@ -107,8 +107,7 @@ main(int argc, char **argv)
infile = stdin;
strcpy(in_name, "<stdin>");
} else if (argc == 1) {
- strncpy(in_name, *argv, PATH_MAX);
- in_name[PATH_MAX] = 0;
+ strlcpy(in_name, *argv, sizeof(in_name));
if ((infile = fopen(in_name, "r")) == NULL)
err(1, "fopen");
} else