* grub-core/osdep/windows/emuconsole.c: Remove unsigned comparison >= 0.

But ensure that the variables in question are indeed unsigned.
This commit is contained in:
Vladimir Serbinenko 2013-12-08 18:16:32 +01:00
parent fa7eb63dec
commit 11e4167a35
2 changed files with 8 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2013-12-08 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/osdep/windows/emuconsole.c: Remove unsigned comparison >= 0.
But ensure that the variables in question are indeed unsigned.
2013-12-08 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/emu/lite.c: Add missing include of ../ia64/dl_helper.c.

View File

@ -108,11 +108,9 @@ grub_console_getkey (struct grub_term_input *term __attribute__ ((unused)))
ret = ir.Event.KeyEvent.uChar.UnicodeChar;
if (ret == 0)
{
if (ir.Event.KeyEvent.wVirtualKeyCode >= 0
&& ir.Event.KeyEvent.wVirtualKeyCode
< ARRAY_SIZE (windows_codes)
&& windows_codes[(int) ir.Event.KeyEvent.wVirtualKeyCode])
ret = windows_codes[(int) ir.Event.KeyEvent.wVirtualKeyCode];
unsigned kc = ir.Event.KeyEvent.wVirtualKeyCode;
if (kc < ARRAY_SIZE (windows_codes) && windows_codes[kc])
ret = windows_codes[kc];
else
continue;
if (ir.Event.KeyEvent.dwControlKeyState & SHIFT_PRESSED)