diff options
| author | guo <[email protected]> | 2021-10-27 17:39:22 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-10-27 17:39:22 +0800 |
| commit | 372858f921785d0bae370be687995c2147218fca (patch) | |
| tree | 9ca0c26e639b16d63147e735c503508c9d88c943 /components | |
| parent | 25bd908fb7ea04e0e9218597b10f75814bf77a4f (diff) | |
[finsh] Fix formatting issues
Diffstat (limited to 'components')
| -rw-r--r-- | components/finsh/shell.c | 7 |
1 files 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); |
