commit 364a1518de0b3573d0d76ab3b40e50c2b2a3994a
parent 93b287775891a1f96a7614a9a9509f6163df69cc
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 22 Jul 2020 11:07:20 +0200
tweaks: reshuffle some lines, to better separate the three cases
Diffstat:
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/winio.c b/src/winio.c
@@ -845,12 +845,16 @@ int assemble_byte_code(int keycode)
{
static int byte = 0;
- /* The first digit is either 0, 1, or 2 (which has been checked before
- * the call. The second digit may be at most 5 if the first was 2. */
- if (++digit_count == 1) {
+ digit_count++;
+
+ /* The first digit is either 0, 1, or 2 (checked before the call). */
+ if (digit_count == 1) {
byte = (keycode - '0') * 100;
return PROCEED;
- } else if (digit_count == 2) {
+ }
+
+ /* The second digit may be at most 5 if the first was 2. */
+ if (digit_count == 2) {
if (byte < 200 || keycode <= '5') {
byte += (keycode - '0') * 10;
return PROCEED;