raiden00pl commented on code in PR #16396:
URL: https://github.com/apache/nuttx/pull/16396#discussion_r2093982271


##########
tools/nxstyle.c:
##########
@@ -719,6 +723,63 @@ static void show_usage(char *progname, int exitcode, char 
*what)
   exit(exitcode);
 }
 
+#ifndef HAVE_STRNDUP
+/********************************************************************************
+ * Name: my_strndup
+ *
+ * Description:
+ *   Duplicate a specific number of bytes from a string.
+ *   Implementation of strndup() for Windows Native
+ *   MinGW does not seem to provide strndup
+ 
********************************************************************************/
+
+char *my_strndup(const char *s, size_t size)
+{
+  char *dest = NULL;
+  size_t len;
+
+  len = strnlen(s, size);
+  len = len < size ? len : size;
+  dest = malloc(len + 1);
+
+  if (dest == NULL)
+    {
+      return NULL;
+    }
+
+  memcpy(dest, s, len);
+  dest[len] = '\0';
+  return dest;
+}
+#undef strndup
+#  define strndup my_strndup
+#endif
+
+/********************************************************************************
+ * Name: backslash_to_slash
+ *
+ * Description:
+ *   Replace backslashes \ to forward slashes /.
+ 
********************************************************************************/

Review Comment:
   ```suggestion
    *   Replace backslashes \ to forward slashes /.
    *
    
********************************************************************************/
   
   ```



-- 
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-unsubscr...@nuttx.apache.org

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

Reply via email to