mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] readline_simple: use len instead of CONFIG_CBSIZE
@ 2017-11-17  4:58 Gaël PORTAY
  2017-11-17  9:14 ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Gaël PORTAY @ 2017-11-17  4:58 UTC (permalink / raw)
  To: barebox; +Cc: Gaël PORTAY

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>
---
 lib/readline_simple.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/readline_simple.c b/lib/readline_simple.c
index 80e075bc5..fcdbca41a 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);
-- 
2.15.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] readline_simple: use len instead of CONFIG_CBSIZE
  2017-11-17  4:58 [PATCH] readline_simple: use len instead of CONFIG_CBSIZE Gaël PORTAY
@ 2017-11-17  9:14 ` Sascha Hauer
  2017-11-17 14:12   ` Gaël PORTAY
  0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2017-11-17  9:14 UTC (permalink / raw)
  To: Gaël PORTAY; +Cc: barebox

On Thu, Nov 16, 2017 at 11:58:14PM -0500, Gaël PORTAY wrote:
> 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>
> ---

Applied, thanks

Sascha

>  lib/readline_simple.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/readline_simple.c b/lib/readline_simple.c
> index 80e075bc5..fcdbca41a 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);
> -- 
> 2.15.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] readline_simple: use len instead of CONFIG_CBSIZE
  2017-11-17  9:14 ` Sascha Hauer
@ 2017-11-17 14:12   ` Gaël PORTAY
  0 siblings, 0 replies; 3+ messages in thread
From: Gaël PORTAY @ 2017-11-17 14:12 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Hi Sascha,

On Fri, Nov 17, 2017 at 10:14:30AM +0100, Sascha Hauer wrote:
> On Thu, Nov 16, 2017 at 11:58:14PM -0500, Gaël PORTAY wrote:
> > 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>
> > ---
> 
> Applied, thanks
> 
> Sascha
>

Thanks

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-17 14:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-17  4:58 [PATCH] readline_simple: use len instead of CONFIG_CBSIZE Gaël PORTAY
2017-11-17  9:14 ` Sascha Hauer
2017-11-17 14:12   ` Gaël PORTAY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox