summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGaël PORTAY <gael.portay@savoirfairelinux.com>2017-11-16 23:58:14 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2017-11-17 10:14:11 +0100
commit30caa3917de8ecfd45f6b12aa4ffe00966f2e250 (patch)
tree9a97fd1c9aa5083dbe41b46b4beb3b32e4181ea7 /lib
parentff312be32a68e51df173b913aa257f60220a3eda (diff)
downloadbarebox-30caa3917de8ecfd45f6b12aa4ffe00966f2e250.tar.gz
barebox-30caa3917de8ecfd45f6b12aa4ffe00966f2e250.tar.xz
readline_simple: use len instead of CONFIG_CBSIZE
It is safier to use the length given in parameter instead of using the preprocessor CONFIG_CBSIZE value. Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/readline_simple.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/readline_simple.c b/lib/readline_simple.c
index 80e075bc5c..fcdbca41a9 100644
--- a/lib/readline_simple.c
+++ b/lib/readline_simple.c
@@ -100,7 +100,7 @@ int readline (const char *prompt, char *line, int len)
/*
* Must be a normal character then
*/
- if (n < CONFIG_CBSIZE-2) {
+ if (n < len-2) {
if (c == '\t') { /* expand TABs */
puts (tab_seq+(col&07));
col += 8 - (col&07);