summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorricky <[email protected]>2025-07-20 17:35:35 +0800
committerGitHub <[email protected]>2025-07-20 17:35:35 +0800
commit9c5aeb75e245d645086dc9388ba76b3633db8310 (patch)
tree18f50d475d398781d0a125986334ff8f8c5ed09b /components
parentece19e961aaa5484e1e48a398b9bc4a2e54f9ed9 (diff)
[Fix] <components>:finsh/shell.c F: char rt_hw_console_getchar(void) (#10345)
[Fix] <components>:finsh/shell.c When using char rt_hw_console_getchar(void), some compilers may default to returning 255 instead of the expected -1, causing the condition if(ch < 0) at F: shell.c L:519 to fail and enter an erroneous loop. Solution: Use the signed char type return value as rt_hw_console_getchar Signed-off-by: Yucai Liu <[email protected]>
Diffstat (limited to 'components')
-rw-r--r--components/finsh/shell.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/finsh/shell.c b/components/finsh/shell.c
index 2b9349364c..bd641db9b6 100644
--- a/components/finsh/shell.c
+++ b/components/finsh/shell.c
@@ -193,7 +193,7 @@ int finsh_getchar(void)
return ch;
#endif /* RT_USING_POSIX_STDIO */
#else
- extern char rt_hw_console_getchar(void);
+ extern signed char rt_hw_console_getchar(void);
return rt_hw_console_getchar();
#endif /* RT_USING_DEVICE */
}