summaryrefslogtreecommitdiff
path: root/graphics/magicpoint/patches/patch-ad
blob: 874e18c347480ea064f56440b5001b6543421fa8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
$NetBSD: patch-ad,v 1.2 2008/09/10 13:32:47 taca Exp $

--- parse.c.orig	2007-11-25 02:35:28.000000000 +0900
+++ parse.c
@@ -470,13 +470,14 @@ read_file(fp, filename, page, line, prea
 		case CTL_TAB:
 		    {
 			int i = root->cti_value;
-			if (i < 0) {
-				fprintf(stderr, "%s:%d: "
-					"invalid tab index %d\n",
-					filename, lineno, root->cti_value);
-				exit(-1);
-			}
-			if (i >= MAXTAB) {	/*XXX*/
+			if (root->ct_type == CTRL_INT) {
+			    if (i < 0 || i >= MAXTAB ) {
+				    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++) {