From aa96fda183953df7df0b6b2d59b6f443b11e42ad Mon Sep 17 00:00:00 2001
From: Akim Demaille <akim@epita.fr>
Date: Sun, 7 Apr 2002 16:29:32 +0000
Subject: [PATCH] * src/output.c (output_rule_data): Fix various range errors:
 `rules' starts at 1, not 0.

---
 ChangeLog    | 6 ++++++
 src/output.c | 6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9ceac057..a219369c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-04-07  Akim Demaille  <akim@epita.fr>
+
+	* src/output.c (output_rule_data): Fix various range errors:
+	`rules' starts at 1, not 0.
+
+	
 2002-04-07  Akim Demaille  <akim@epita.fr>
 
 	Remove the useless rules from the parser.
diff --git a/src/output.c b/src/output.c
index 910eae4a..63b1e0dc 100644
--- a/src/output.c
+++ b/src/output.c
@@ -192,7 +192,7 @@ output_gram (void)
   {
     int i;
     short *values = XCALLOC (short, nrules + 1);
-    for (i = 0; i < nrules + 1; ++i)
+    for (i = 1; i < nrules + 1; ++i)
       values[i] = rules[i].rhs - ritem;
     output_table_data (&format_obstack, values,
 		       0, 1, nrules + 1);
@@ -246,7 +246,7 @@ output_rule_data (void)
 
   {
     short *values = XCALLOC (short, nrules + 1);
-    for (i = 0; i < nrules + 1; ++i)
+    for (i = 1; i < nrules + 1; ++i)
       values[i] = rules[i].line;
     output_table_data (&format_obstack, values,
 		       0, 1, nrules + 1);
@@ -299,7 +299,7 @@ output_rule_data (void)
   /* Output YYR1. */
   {
     short *values = XCALLOC (short, nrules + 1);
-    for (i = 0; i < nrules + 1; ++i)
+    for (i = 1; i < nrules + 1; ++i)
       values[i] = rules[i].lhs;
     output_table_data (&format_obstack, values,
 		       0, 1, nrules + 1);
-- 
2.45.2