You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/01/21 11:43:11 UTC

[GitHub] [incubator-nuttx-apps] a-lunev commented on a change in pull request #972: netutils/netcat: fixed ISO C89/C90 related warnings

a-lunev commented on a change in pull request #972:
URL: https://github.com/apache/incubator-nuttx-apps/pull/972#discussion_r789589963



##########
File path: netutils/netcat/netcat_main.c
##########
@@ -44,18 +44,23 @@
 # define NETCAT_PORT 31337
 #endif
 
+#ifndef NETCAT_IOBUF_SIZE
+# define NETCAT_IOBUF_SIZE 256
+#endif
+
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
 
 int do_io(int infd, int outfd)
 {
-  size_t capacity = 256;
-  char buf[capacity];
+  ssize_t avail;
+  ssize_t written;
+  char buf[NETCAT_IOBUF_SIZE];
 
   while (true)
     {
-      ssize_t avail = read(infd, buf, capacity);

Review comment:
       Yes, "ssize_t avail" was moved not because of C89. I moved it together with moving "ssize_t written" that was C89 related issue. So I moved "ssize_t avail" for uniformity reasons.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org