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 2021/01/26 13:23:29 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 edited a comment on pull request #2739: fs/readdir: Must reserve a byte for the NUL terminator

xiaoxiang781216 edited a comment on pull request #2739:
URL: https://github.com/apache/incubator-nuttx/pull/2739#issuecomment-767535725


   32 char is defined by NuttX, but many file system support file name length more than 32 char, and then the generated disk image may contain the item with long name, we should don't crash or hang the system in this case at least just because the string isn't null terminated.
   
   > So is this for external files names not created by NuttX? Won't it be It will be a breaking change for systems that had say had say 32 and now this code makes it 31 chars.
   
   No, if the length is exactly 32 bytes, nothing change at all. The real difference is when the file name is longer than 32 bytes. Before the changing, we have a string with 33 char without null terminator. After the change, we have a string with 32 char and null terminator.


----------------------------------------------------------------
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:
users@infra.apache.org