yamt commented on a change in pull request #2572:
URL: https://github.com/apache/incubator-nuttx/pull/2572#discussion_r546521690



##########
File path: fs/spiffs/src/spiffs_vfs.c
##########
@@ -330,7 +330,14 @@ static int spiffs_readdir_callback(FAR struct spiffs_s *fs,
       DEBUGASSERT(dir != NULL);
       entryp = &dir->fd_dir;
 
-      strncpy(entryp->d_name, (FAR char *)objhdr.name, NAME_MAX + 1);
+      /* Skip the leading '/'. */
+
+      if (objhdr.name[0] != '/')

Review comment:
       do you have specific reasons to make this that smart?
   generally i don't think it's a good idea to put this kind of smart things 
unless absolutely necessary.
   




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

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


Reply via email to