mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
Fix wrong parameter size
Type int expects 4 bytes for function write(). Type char expects 1 byte which matches the real usage of function write(). Signed-off-by: renzhiyuan1 <renzhiyuan1@xiaomi.com>
This commit is contained in:
parent
53878a53db
commit
fece67ee4b
1 changed files with 5 additions and 2 deletions
|
|
@ -446,13 +446,16 @@ int main(int argc, FAR char *argv[])
|
|||
|
||||
while (!cu->force_exit)
|
||||
{
|
||||
int ch = getc(stdin);
|
||||
char ch;
|
||||
int c = getc(stdin);
|
||||
|
||||
if (ch < 0)
|
||||
if (c < 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
ch = c;
|
||||
|
||||
if (nobreak == 1)
|
||||
{
|
||||
write(cu->outfd, &ch, 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue