do not look beyond the end of the buffer
authorNick Clifton <nickc@redhat.com>
Fri, 12 Nov 1999 11:02:56 +0000 (11:02 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 12 Nov 1999 11:02:56 +0000 (11:02 +0000)
gas/ChangeLog
gas/macro.c

index 62002ebcc90a1de6adddbac8d1d3b37e1b447ec3..72f3ab3fb0f9b656211ad15a156acd414c36e085 100644 (file)
@@ -1,3 +1,8 @@
+1999-11-12  Nick Clifton  <nickc@cygnus.com>
+
+       * macro.c (buffer_and_nest): Do not check beyond the end of the
+       buffer. 
+
 1999-11-11  Nick Clifton  <nickc@cygnus.com>
 
        * macro.c (buffer_and_nest): Look for seperator after TO and
index 2ef4cb400f8b8612cf2e14ab1b727daa439085f3..1c33de3a229df11deb045f4c8afd1433d7213812 100644 (file)
@@ -246,10 +246,10 @@ buffer_and_nest (from, to, ptr, get_line)
          if (ptr->ptr[i] == '.')
              i++;
          if (strncasecmp (ptr->ptr + i, from, from_len) == 0
-             && ! isalnum (ptr->ptr[i + from_len]))
+             && (ptr->len == (i + from_len || ! isalnum (ptr->ptr[i + from_len]))))
            depth++;
          if (strncasecmp (ptr->ptr + i, to, to_len) == 0
-             && ! isalnum (ptr->ptr[i + to_len]))
+             && (ptr->len == (i + to_len) || ! isalnum (ptr->ptr[i + to_len])))
            {
              depth--;
              if (depth == 0)