This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Fix to previous patch to macro.c


Hi Guys,

  I have checked in the patch below to fix my change to macro.c that I
  made yesterday.  I forgot to check the length of the buffer, and to
  make sure that I was not looking beyond the end of the buffer.

Cheers
	Nick

1999-11-12  Nick Clifton  <nickc@cygnus.com>

	* macro.c (buffer_and_nest): Do not check beyond the end of the
	buffer. 

Index: macro.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gas/macro.c,v
retrieving revision 1.26
diff -p -r1.26 macro.c
*** macro.c	1999/11/11 08:36:40	1.26
--- macro.c	1999/11/12 10:58:47
*************** buffer_and_nest (from, to, ptr, get_line
*** 246,255 ****
  	  if (ptr->ptr[i] == '.')
  	      i++;
  	  if (strncasecmp (ptr->ptr + i, from, from_len) == 0
! 	      && ! isalnum (ptr->ptr[i + from_len]))
  	    depth++;
  	  if (strncasecmp (ptr->ptr + i, to, to_len) == 0
! 	      && ! isalnum (ptr->ptr[i + to_len]))
  	    {
  	      depth--;
  	      if (depth == 0)
--- 246,255 ----
  	  if (ptr->ptr[i] == '.')
  	      i++;
  	  if (strncasecmp (ptr->ptr + i, from, from_len) == 0
! 	      && (ptr->len == (i + from_len || ! isalnum (ptr->ptr[i + from_len]))))
  	    depth++;
  	  if (strncasecmp (ptr->ptr + i, to, to_len) == 0
! 	      && (ptr->len == (i + to_len) || ! isalnum (ptr->ptr[i + to_len])))
  	    {
  	      depth--;
  	      if (depth == 0)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]