]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Formerly read.c.~36~
authorRoland McGrath <roland@redhat.com>
Tue, 15 Sep 1992 19:14:03 +0000 (19:14 +0000)
committerRoland McGrath <roland@redhat.com>
Tue, 15 Sep 1992 19:14:03 +0000 (19:14 +0000)
read.c

diff --git a/read.c b/read.c
index 4a997b96fa42be5f9bdb96492f31064df881bc1b..5933447dfe62ddc81aa1bedcdcf8fbedc9c80196 100644 (file)
--- 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)