File tree Expand file tree Collapse file tree 3 files changed +3
-2
lines changed
Expand file tree Collapse file tree 3 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ static void createSubfolders(const char* fileName)
2929 while ((token = strchr (fileName , '/' )) != NULL )
3030 {
3131 uint32_t length = (uint32_t )(token - fileName + 1 );
32- pathTail = ffStrCopyN (pathTail , fileName , length );
32+ pathTail = ffStrCopyN (pathTail , fileName , length + 1 );
3333 mkdir (path , S_IRWXU | S_IRGRP | S_IROTH );
3434 fileName = token + 1 ;
3535 }
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ static void createSubfolders(const char* fileName)
1414 while ((token = strchr (fileName , '/' )) != NULL )
1515 {
1616 uint32_t length = (uint32_t )(token - fileName + 1 );
17- pathTail = ffStrCopyN (pathTail , fileName , length );
17+ pathTail = ffStrCopyN (pathTail , fileName , length + 1 );
1818 CreateDirectoryA (path , NULL );
1919 fileName = token + 1 ;
2020 }
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ static inline bool ffCharIsDigit(char c)
8080 return '0' <= c && c <= '9' ;
8181}
8282
83+ // ffStrCopyN copies at most (nDst - 1) bytes from src to dst
8384static inline char * ffStrCopyN (char * __restrict__ dst , const char * __restrict__ src , size_t nDst )
8485{
8586 assert (dst != NULL );
You can’t perform that action at this time.
0 commit comments