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 06:58:56 UTC

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

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



##########
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:
       Actually this is not a C89 issue. Standard allows this.




-- 
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