summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorbernard <[email protected]>2026-10-18 20:41:46 +0800
committerRbb666 <[email protected]>2026-10-29 14:48:33 +0800
commitb4c6828cf4318fd22cee9325efc4ddfac28a7458 (patch)
tree8db55689c37da813aa21cee826a56bfff9df9684 /components
parent24c624aa7aaa2bead494f1f56b3ac7f3af1c46cf (diff)
[components][lwp] fix TTY init format and control character copy
- place the TIOCLINUX case brace on its own line - use sizeof(tty_ctrl_charset) directly as the memcpy size - fix the cppcheck sizeofDivisionMemfunc warning
Diffstat (limited to 'components')
-rw-r--r--components/lwp/terminal/freebsd/tty_compat.c3
-rw-r--r--components/lwp/terminal/tty_device.c3
2 files changed, 3 insertions, 3 deletions
diff --git a/components/lwp/terminal/freebsd/tty_compat.c b/components/lwp/terminal/freebsd/tty_compat.c
index c89da7a315..338489d549 100644
--- a/components/lwp/terminal/freebsd/tty_compat.c
+++ b/components/lwp/terminal/freebsd/tty_compat.c
@@ -547,7 +547,8 @@ int lwp_tty_ioctl_adapter(lwp_tty_t tp, int cmd, int oflags, void *args, rt_thre
error = (IOCTL(FIONREAD, args, fflags, td));
break;
- case TIOCLINUX: {
+ case TIOCLINUX:
+ {
/*
* Linux uses TIOCLINUX to obtain console keyboard modifier
* state. RT-Thread serial consoles do not expose that state,
diff --git a/components/lwp/terminal/tty_device.c b/components/lwp/terminal/tty_device.c
index b4b3637250..a2936a0d1b 100644
--- a/components/lwp/terminal/tty_device.c
+++ b/components/lwp/terminal/tty_device.c
@@ -351,8 +351,7 @@ static void tty_init_termios(lwp_tty_t tp)
tp->t_winsize.ws_row = 24;
tp->t_winsize.ws_col = 80;
- memcpy(&t->c_cc, tty_ctrl_charset,
- sizeof(tty_ctrl_charset) / sizeof(tty_ctrl_charset[0]));
+ memcpy(&t->c_cc, tty_ctrl_charset, sizeof(tty_ctrl_charset));
#ifdef USING_BSD_INIT_LOCK_DEVICE
tp->t_termios_init_out = *t;