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:
renzhiyuan1 2023-08-30 12:19:50 +08:00 committed by Petro Karashchenko
parent 53878a53db
commit fece67ee4b

View File

@ -446,13 +446,16 @@ int main(int argc, FAR char *argv[])
while (!cu->force_exit) while (!cu->force_exit)
{ {
int ch = getc(stdin); char ch;
int c = getc(stdin);
if (ch < 0) if (c < 0)
{ {
continue; continue;
} }
ch = c;
if (nobreak == 1) if (nobreak == 1)
{ {
write(cu->outfd, &ch, 1); write(cu->outfd, &ch, 1);