From 30caa3917de8ecfd45f6b12aa4ffe00966f2e250 Mon Sep 17 00:00:00 2001 From: Gaël PORTAY Date: Thu, 16 Nov 2017 23:58:14 -0500 Subject: readline_simple: use len instead of CONFIG_CBSIZE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is safier to use the length given in parameter instead of using the preprocessor CONFIG_CBSIZE value. Signed-off-by: Gaël PORTAY Signed-off-by: Sascha Hauer --- lib/readline_simple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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); -- cgit v1.2.3