--- skey-1.1.5-orig/put.c	2008-09-21 10:12:06.000000000 +0200
+++ skey-1.1.5/put.c	2008-09-21 10:19:54.000000000 +0200
@@ -2206,27 +2206,17 @@
 {
 	int i, j;
 
-	for (;;) {
+	while (low <= high) {
 		i = (low + high) / 2;
 
 		if ((j = strncmp(w, Wp[i], 4)) == 0)
 			return i;			/* Found it */
-		if (high == low + 1) 
-		{
-			/* Avoid effects of integer truncation in /2 */
-			if (strncmp(w, Wp[high], 4) == 0)
-				return high;
-			else
-				return -1;
-		}
-
-		if (low >= high)
-			return -1;	/* I don't *think* this can happen... */
 		if (j < 0)
-			high = i;	/* Search lower half */
+			high = i - 1;	/* Search lower half */
 		else
-			low = i;	/* Search upper half */
+			low = i + 1;	/* Search upper half */
 	}
+	return -1;
 }
 
 static void insert(char *s, int x, int start, int length)
