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/08/21 21:38:34 UTC

[GitHub] [incubator-nuttx] acassis commented on a diff in pull request #6883: arch/sim: set CMDLINE env to the argument user pass to nuttx

acassis commented on code in PR #6883:
URL: https://github.com/apache/incubator-nuttx/pull/6883#discussion_r950903358


##########
arch/sim/src/sim/up_initialize.c:
##########
@@ -31,12 +31,30 @@
 #include <nuttx/spi/spi_flash.h>
 #include <nuttx/spi/qspi_flash.h>
 
+#include <stdlib.h>
+
 #include "up_internal.h"
 
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
 
+#ifndef CONFIG_DISABLE_ENVIRON
+static void up_init_cmdline(void)
+{
+  char cmdline[ARG_MAX] = "";
+  int i;
+
+  for (i = 1; i < g_argc; i++)
+    {
+      strcat(cmdline, g_argv[i]);

Review Comment:
   It could be a good idea to use strncat and ARG_MAX to make it a little bit safer



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