Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/common/io/io_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static void createSubfolders(const char* fileName)
while((token = strchr(fileName, '/')) != NULL)
{
uint32_t length = (uint32_t)(token - fileName + 1);
pathTail = ffStrCopyN(pathTail, fileName, length);
pathTail = ffStrCopyN(pathTail, fileName, length + 1);
mkdir(path, S_IRWXU | S_IRGRP | S_IROTH);
fileName = token + 1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/io/io_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static void createSubfolders(const char* fileName)
while((token = strchr(fileName, '/')) != NULL)
{
uint32_t length = (uint32_t)(token - fileName + 1);
pathTail = ffStrCopyN(pathTail, fileName, length);
pathTail = ffStrCopyN(pathTail, fileName, length + 1);
CreateDirectoryA(path, NULL);
fileName = token + 1;
}
Expand Down
1 change: 1 addition & 0 deletions src/util/stringUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ static inline bool ffCharIsDigit(char c)
return '0' <= c && c <= '9';
}

// ffStrCopyN copies at most (nDst - 1) bytes from src to dst
static inline char* ffStrCopyN(char* __restrict__ dst, const char* __restrict__ src, size_t nDst)
{
assert(dst != NULL);
Expand Down
Loading