changeset 5542:dab422055bab

Correct array bound for syntax_code_spec.
author Stephen J. Turnbull <stephen@xemacs.org>
date Mon, 08 Aug 2011 13:57:20 +0900
parents ebd367b82ccd
children fbe90e6f7a43
files src/ChangeLog src/search.c src/syntax.c src/syntax.h
diffstat 4 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Aug 08 13:57:19 2011 +0900
+++ b/src/ChangeLog	Mon Aug 08 13:57:20 2011 +0900
@@ -1,3 +1,14 @@
+2011-08-05  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	There are only (octal) 0200 ASCII characters, and only 128 values
+	supplied in the definition.
+
+	* syntax.h (syntax_spec_code):
+	* syntax.c (syntax_spec_code):
+	Declare array with correct dimension.
+	* search.c (skip_chars):
+	Correct bounds check on index of syntax_spec_code.
+
 2011-08-04  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* search.c (byte_scan_buffer):
--- a/src/search.c	Mon Aug 08 13:57:19 2011 +0900
+++ b/src/search.c	Mon Aug 08 13:57:20 2011 +0900
@@ -926,7 +926,7 @@
       INC_IBYTEPTR (p);
       if (syntaxp)
 	{
-	  if (c < 0400 && syntax_spec_code[c] < (unsigned char) Smax)
+	  if (c < 0200 && syntax_spec_code[c] < (unsigned char) Smax)
 	    fastmap[c] = 1;
 	  else
 	    invalid_argument ("Invalid syntax designator", make_char (c));
--- a/src/syntax.c	Mon Aug 08 13:57:19 2011 +0900
+++ b/src/syntax.c	Mon Aug 08 13:57:20 2011 +0900
@@ -600,7 +600,7 @@
    into the code it signifies.
    This is used by modify-syntax-entry, and other things. */
 
-const unsigned char syntax_spec_code[0400] =
+const unsigned char syntax_spec_code[0200] =
 { 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377,
   0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377,
   0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377,
--- a/src/syntax.h	Mon Aug 08 13:57:19 2011 +0900
+++ b/src/syntax.h	Mon Aug 08 13:57:20 2011 +0900
@@ -262,7 +262,7 @@
    that character signifies (as a char).
    For example, (enum syntaxcode) syntax_spec_code['w'] is Sword. */
 
-extern const unsigned char syntax_spec_code[0400];
+extern const unsigned char syntax_spec_code[0200];
 
 /* Indexed by syntax code, give the letter that describes it. */