summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1992-09-15 19:14:03 +0000
committerRoland McGrath <roland@redhat.com>1992-09-15 19:14:03 +0000
commit53f7c279562ffbe754ac66163e1c4d61e3a37beb (patch)
tree35e3a44c7bf95cd36ab26cdf623ccabd72e0b199
parent44251cbc0c4c9899b8eb7eaec5c179c547f4d6b9 (diff)
downloadgunmake-53f7c279562ffbe754ac66163e1c4d61e3a37beb.tar.gz
Formerly read.c.~36~
-rw-r--r--read.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/read.c b/read.c
index 4a997b9..5933447 100644
--- a/read.c
+++ b/read.c
@@ -334,8 +334,9 @@ read_makefile (filename, type)
if (*p == '\0' && lb.buffer[0] != '\t')
continue;
-#define word1eq(s, l) ((p[l] == '\0' || isblank (p[l])) && \
- !strncmp (s, p, l))
+ /* strncmp is first to avoid dereferencing out into space. */
+#define word1eq(s, l) (!strncmp (s, p, l) \
+ && (p[l] == '\0' || isblank (p[l])))
if (!in_ignored_define
&& word1eq ("ifdef", 5) || word1eq ("ifndef", 6)
|| word1eq ("ifeq", 4) || word1eq ("ifneq", 5)