readkey: Use ARRAY_SIZE
Update to commit:
6df16cb
readkey: force return from while true
Use ARRAY_SIZE instead of hardcoded value
Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
a2b6da5e66
commit
e26c1c52ba
|
@ -67,7 +67,7 @@ int read_key(void)
|
||||||
esc[i] = getc();
|
esc[i] = getc();
|
||||||
if (esc[i++] == '~')
|
if (esc[i++] == '~')
|
||||||
break;
|
break;
|
||||||
if (i == 5)
|
if (i == ARRAY_SIZE(esc))
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue