ascii.c (ascii_reserve) Added assertion.
[pspp] / src / output / ascii.c
index 1c3e6b8238f8f7f0739310ae64bfea6b5778c3bb..7804ade3f475d9e0cc08fa281be5a2d5ed6677d5 100644 (file)
@@ -749,7 +749,9 @@ find_ascii_pos (struct ascii_line *line, int target_x, struct ascii_pos *c)
 static char *
 ascii_reserve (struct ascii_driver *a, int y, int x0, int x1, int n)
 {
-  struct ascii_line *line = &a->lines[y];
+  struct ascii_line *line;
+  assert (y < a->allocated_lines);
+  line = &a->lines[y];
 
   if (x0 >= line->width)
     {