From b58ffc0f9f8c9efd0569a1da3ad2894bd2fff48a Mon Sep 17 00:00:00 2001
From: Bernardo Innocenti <bernie@codewiz.org>
Date: Mon, 11 Jun 2007 06:12:15 -0400
Subject: [PATCH] Enlarge key table size and give a clue instead of just crashing next time.
Organization: One Laptop Per Child

---
 src/util/makekeys.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/util/makekeys.c b/src/util/makekeys.c
index 214ea5c..afc3854 100644
--- a/src/util/makekeys.c
+++ b/src/util/makekeys.c
@@ -42,7 +42,7 @@ char *malloc();
 
 typedef unsigned long Signature;
 
-#define KTNUM 3000
+#define KTNUM 4000
 
 static struct info {
     char	*name;
@@ -157,6 +157,11 @@ next1:	;
     }
 
     z = best_z;
+    if (z == 0) {
+	    fprintf(stderr, "makekeys: try increasing KTNUM!\n");
+	    exit(1);
+    }
+
     printf("#ifdef NEEDKTABLE\n");
     printf("const unsigned char _XkeyTable[] = {\n");
     printf("0,\n");
-- 
1.5.2

