[PATCH 04/36] read_key: Use ARRAY_SIZE instead of hardcoded value

Sascha Hauer s.hauer at pengutronix.de
Fri Dec 18 10:47:53 EST 2009


Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 lib/readkey.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/readkey.c b/lib/readkey.c
index 5937fd0..0464ce4 100644
--- a/lib/readkey.c
+++ b/lib/readkey.c
@@ -70,7 +70,7 @@ char read_key(void)
 			}
 		}
 		esc[i] = 0;
-		for (i = 0; i < 18; i++){
+		for (i = 0; i < ARRAY_SIZE(esccmds); i++){
 			if (!strcmp(esc, esccmds[i].seq))
 				return esccmds[i].val;
 		}
-- 
1.6.5.2




More information about the barebox mailing list