Commit Diff


commit - adb8f9696359f84269d70a68812bcecba9283f79
commit + 63ecae6d1372b9e3b17e6b20de91af78cd2ba107
blob - 8276391fde6c4cacf478669e857d4cfd80ffbc29
blob + 71986c1dc01e7bff98b6aeed9790c67a55d1e119
--- ui.c
+++ ui.c
@@ -204,14 +204,16 @@ readkey(void)
 	}
 
 	thiskey.cp = 0;
-	if ((unsigned int)thiskey.key < UINT8_MAX) {
-		while (1) {
-			if (!utf8_decode(&state, &thiskey.cp, (uint8_t)thiskey.key))
-				break;
-			if ((thiskey.key = wgetch(body)) == ERR) {
-				message("Error decoding user input");
-				return 0;
-			}
+
+	if ((unsigned int)thiskey.key >= UINT8_MAX)
+		return 1;
+
+	while (1) {
+		if (!utf8_decode(&state, &thiskey.cp, (uint8_t)thiskey.key))
+			break;
+		if ((thiskey.key = wgetch(body)) == ERR) {
+			message("Error decoding user input");
+			return 0;
 		}
 	}