summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-02-06 18:30:34 +0000
committerUlrich Drepper <drepper@redhat.com>2004-02-06 18:30:34 +0000
commit1e7947dcc92a6488d77e98da148ce64517999c0b (patch)
treece4ecf97df192e21a6dc03a718b7220584fdf41d
parent1bf5cffd64af39416e93354dae4b5e6df4c414fc (diff)
downloadglibc-1e7947dcc92a6488d77e98da148ce64517999c0b.tar.gz
glibc-1e7947dcc92a6488d77e98da148ce64517999c0b.tar.xz
glibc-1e7947dcc92a6488d77e98da148ce64517999c0b.zip
Update.
2004-02-06  Andreas Schwab  <schwab@suse.de>

	* posix/regcomp.c (build_range_exp): Fix off-by-one.
	(parse_bracket_exp): Likewise.
-rw-r--r--ChangeLog5
-rw-r--r--posix/regcomp.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 481452940a..58a114cfc3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-02-06  Andreas Schwab  <schwab@suse.de>
+
+	* posix/regcomp.c (build_range_exp): Fix off-by-one.
+	(parse_bracket_exp): Likewise.
+
 2004-02-05  Ulrich Drepper  <drepper@redhat.com>
 
 	* sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h: Define
diff --git a/posix/regcomp.c b/posix/regcomp.c
index 33ca7c91e1..96b63a40f0 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -2603,7 +2603,7 @@ build_range_exp (sbcset, start_elem, end_elem)
       }
 
     /* Build the table for single byte characters.  */
-    for (wc = 0; wc <= SBC_MAX; ++wc)
+    for (wc = 0; wc < SBC_MAX; ++wc)
       {
 	cmp_buf[2] = wc;
 	if (wcscoll (cmp_buf, cmp_buf + 2) <= 0
@@ -2623,7 +2623,7 @@ build_range_exp (sbcset, start_elem, end_elem)
     if (start_ch > end_ch)
       return REG_ERANGE;
     /* Build the table for single byte characters.  */
-    for (ch = 0; ch <= SBC_MAX; ++ch)
+    for (ch = 0; ch < SBC_MAX; ++ch)
       if (start_ch <= ch  && ch <= end_ch)
 	bitset_set (sbcset, ch);
   }
@@ -2846,7 +2846,7 @@ parse_bracket_exp (regexp, dfa, token, syntax, err)
 	}
 
       /* Build the table for single byte characters.  */
-      for (ch = 0; ch <= SBC_MAX; ch++)
+      for (ch = 0; ch < SBC_MAX; ch++)
 	{
 	  uint32_t ch_collseq;
 	  /*