--- rxvt-unicode/src/keyboard.C 2005/01/16 18:57:03 1.4 +++ rxvt-unicode/src/keyboard.C 2005/01/16 19:20:30 1.6 @@ -59,8 +59,7 @@ else if (rt->meta_char == C0_ESC) /* escape prefix */ #endif { - const unsigned char - ch = C0_ESC; + const unsigned char ch = C0_ESC; rt->tt_write (&ch, 1); } } @@ -75,12 +74,13 @@ if (len >= bufsize) { - fprintf (stderr, "buffer overflowed!\n"); - buf[bufsize - 1] = '\0'; + rxvt_warn ("buffer overflowed!\n"); + *buf = 0; } else if (len < 0) { - perror ("keyrange_translator()"); + rxvt_warn ("keyrange_translator(), snprintf error"); + *buf = 0; } return len; @@ -238,11 +238,9 @@ { assert (hash[0] == 0 && "register_done() need to be called"); - if (state & term->ModMetaMask) - state |= MetaMask; - - if (state & term->ModNumLockMask) - state |= NumLockMask; + if (state & term->ModMetaMask) state |= MetaMask; + if (state & term->ModNumLockMask) state |= NumLockMask; + if (state & term->ModLevel3Mask) state |= Level3Mask; if (!!(term->priv_modes & PrivMode_aplKP) != !!(state & ShiftMask)) state |= AppKeypadMask; @@ -437,6 +435,7 @@ for (int j = 0; j < a->range; ++j) { int index = find_keysym (a->keysym + j, a->state & OtherModMask); + assert (index >= 0); keysym_t *b = keymap [index]; assert (i == (signed) index || // the normally expected result