eed7c62887
All fixes by yours truly.
30 lines
804 B
Plaintext
30 lines
804 B
Plaintext
$OpenBSD: patch-parse_c,v 1.2 2011/07/08 20:38:00 naddy Exp $
|
|
--- parse.c.orig Mon Sep 17 08:48:30 2001
|
|
+++ parse.c Thu Jul 7 08:59:48 2011
|
|
@@ -355,14 +355,17 @@ read_file(fp, filename, page, line, preamble)
|
|
|
|
case CTL_TAB:
|
|
{
|
|
- int i = root->cti_value - 1;
|
|
- if (i < 0) {
|
|
- fprintf(stderr, "%s:%d: "
|
|
- "invalid tab index %d\n",
|
|
- filename, lineno, root->cti_value);
|
|
- exit(-1);
|
|
- }
|
|
- if (i >= MAXTAB) { /*XXX*/
|
|
+ int i;
|
|
+
|
|
+ if (root->ct_type == CTL_INT) {
|
|
+ i = root->cti_value - 1;
|
|
+ if (i < 0) {
|
|
+ fprintf(stderr, "%s:%d: "
|
|
+ "invalid tab index %d\n",
|
|
+ filename, lineno, root->cti_value);
|
|
+ exit(-1);
|
|
+ }
|
|
+ } else {
|
|
/* must be a string */
|
|
/* find a free entry */
|
|
for (i = MAXTAB ; i < MAXTAB + MAXSTYLE ; i++) {
|