bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 01/08] i386/i386at/kd.c (kdintr): quiet the GCC warning about sig


From: Marin Ramesa
Subject: [PATCH 01/08] i386/i386at/kd.c (kdintr): quiet the GCC warning about signed overflow
Date: Tue, 10 Dec 2013 19:19:56 +0100

WIDTH_KMAP is the number of columns in the key_map table. Check
if char_idx is less than WIDTH_KMAP and break the for loop if
that is not the case.

i386/i386at/kd.c (kdintr): Break the for loop if char_idx is larger or equal to 
WIDTH_KMAP.

---
 i386/i386at/kd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/i386/i386at/kd.c b/i386/i386at/kd.c
index 757bce2..6b7f242 100644
--- a/i386/i386at/kd.c
+++ b/i386/i386at/kd.c
@@ -849,7 +849,7 @@ int vec;
                         * char sequence, for function keys) onto the
                         * input queue.
                         */
-                       for ( ; (c != K_DONE) && (char_idx <= max);
+                       for ( ; (c != K_DONE) && (char_idx <= max) && (char_idx 
< WIDTH_KMAP);
                             c = key_map[scancode][char_idx++]) {
                                (*linesw[tp->t_line].l_rint)(c, tp);
                        }
-- 
1.8.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]