summaryrefslogtreecommitdiff
path: root/usr.bin/make/arch.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-07-02 20:47:29 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-07-02 20:47:29 +0000
commit1ddbadcdf0b3d98f4bbf1fcc64f13fed93faabc9 (patch)
tree3713040e71827524350983a34ac2ed1ba8a2266f /usr.bin/make/arch.c
parent26ced62b330504f2eefd1ad38228354a57fc5733 (diff)
Fix a bug where make gets confused by targets beginning with a period (``.'')
and tried to do a suffix conversion, following a NULL pointer in the proccess. Also add some sanity checks so we don't blindly assume strchr returns non-NULL.
Diffstat (limited to 'usr.bin/make/arch.c')
-rw-r--r--usr.bin/make/arch.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c
index 4a27c351ffb..ad5e76c6514 100644
--- a/usr.bin/make/arch.c
+++ b/usr.bin/make/arch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arch.c,v 1.11 1997/10/13 14:47:14 pefo Exp $ */
+/* $OpenBSD: arch.c,v 1.12 1998/07/02 20:47:25 millert Exp $ */
/* $NetBSD: arch.c,v 1.17 1996/11/06 17:58:59 christos Exp $ */
/*
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94";
#else
-static char rcsid[] = "$OpenBSD: arch.c,v 1.11 1997/10/13 14:47:14 pefo Exp $";
+static char rcsid[] = "$OpenBSD: arch.c,v 1.12 1998/07/02 20:47:25 millert Exp $";
#endif
#endif /* not lint */
@@ -1064,7 +1064,7 @@ Arch_MemMTime (gn)
nameStart = strchr (pgn->name, '(') + 1;
nameEnd = strchr (nameStart, ')');
- if (pgn->make &&
+ if (pgn->make && nameStart != (char *)1 && nameEnd != NULL &&
strncmp(nameStart, gn->name, nameEnd - nameStart) == 0) {
gn->mtime = Arch_MTime(pgn);
}