From fece67ee4bcf9536ca88d4d7071ad17490fcc78b Mon Sep 17 00:00:00 2001 From: renzhiyuan1 Date: Wed, 30 Aug 2023 12:19:50 +0800 Subject: [PATCH] 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 --- system/cu/cu_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/system/cu/cu_main.c b/system/cu/cu_main.c index bb6b6d7a1..6252667ca 100644 --- a/system/cu/cu_main.c +++ b/system/cu/cu_main.c @@ -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);