This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new fece67ee4 Fix wrong parameter size
fece67ee4 is described below

commit fece67ee4bcf9536ca88d4d7071ad17490fcc78b
Author: renzhiyuan1 <[email protected]>
AuthorDate: Wed Aug 30 12:19:50 2023 +0800

    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 <[email protected]>
---
 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);

Reply via email to