From 372858f921785d0bae370be687995c2147218fca Mon Sep 17 00:00:00 2001 From: guo Date: Wed, 27 Oct 2021 17:39:22 +0800 Subject: [PATCH] [finsh] Fix formatting issues --- components/finsh/shell.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/finsh/shell.c b/components/finsh/shell.c index 7305bb0370..6938ed1f24 100644 --- a/components/finsh/shell.c +++ b/components/finsh/shell.c @@ -145,18 +145,17 @@ void finsh_set_prompt_mode(rt_uint32_t prompt_mode) int finsh_getchar(void) { #ifdef RT_USING_DEVICE + char ch = 0; #ifdef RT_USING_POSIX - int c; - if(read(STDIN_FILENO,&c,1)>0) + if(read(STDIN_FILENO, &ch, 1) > 0) { - return c; + return ch; } else { return -1; /* EOF */ } #else - char ch = 0; rt_device_t device; RT_ASSERT(shell != RT_NULL); -- GitLab