summaryrefslogtreecommitdiffstats
path: root/usr.bin/make
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-03-01 06:03:17 +0000
committerimp <imp@FreeBSD.org>2001-03-01 06:03:17 +0000
commit8ea05a7c1358dd9820e376937b619eb140b8e3d3 (patch)
tree576968a0b71414285e0006b1d6320325bdebcde4 /usr.bin/make
parent9ff30f68ab87bdd5ef77832a8882419c6c462a22 (diff)
downloadFreeBSD-src-8ea05a7c1358dd9820e376937b619eb140b8e3d3.zip
FreeBSD-src-8ea05a7c1358dd9820e376937b619eb140b8e3d3.tar.gz
MAXPATHLEN includes the trailing NUL.
Correct array sizes to reflect this. Correct NUL termination after strncpy. # Didn't to strncpy -> strlcpy change.
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/arch.c4
-rw-r--r--usr.bin/make/main.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c
index a3a2a6a..a842577 100644
--- a/usr.bin/make/arch.c
+++ b/usr.bin/make/arch.c
@@ -478,7 +478,7 @@ ArchStatMember (archive, member, hash)
Arch *ar; /* Archive descriptor */
Hash_Entry *he; /* Entry containing member's description */
struct ar_hdr arh; /* archive-member header for reading archive */
- char memName[MAXPATHLEN+1];
+ char memName[MAXPATHLEN];
/* Current member name while hashing. */
/*
@@ -760,7 +760,7 @@ ArchSVR4Entry(ar, name, size, arch)
}
(void) strncpy(name, &ar->fnametab[entry], MAXPATHLEN);
- name[MAXPATHLEN] = '\0';
+ name[MAXPATHLEN - 1] = '\0';
return 1;
}
#endif
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 8ff1de3..dc8c8c8 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -467,9 +467,9 @@ main(argc, argv)
struct stat sb;
char *pwd;
#endif
- char mdpath[MAXPATHLEN + 1];
- char obpath[MAXPATHLEN + 1];
- char cdpath[MAXPATHLEN + 1];
+ char mdpath[MAXPATHLEN];
+ char obpath[MAXPATHLEN];
+ char cdpath[MAXPATHLEN];
char *machine = getenv("MACHINE");
char *machine_arch = getenv("MACHINE_ARCH");
char *machine_cpu = getenv("MACHINE_CPU");
@@ -936,7 +936,7 @@ ReadMakefile(p, q)
char *fname = p; /* makefile to read */
extern Lst parseIncPath;
FILE *stream;
- char *name, path[MAXPATHLEN + 1];
+ char *name, path[MAXPATHLEN];
if (!strcmp(fname, "-")) {
Parse_File("(stdin)", stdin);
OpenPOWER on IntegriCloud