Skip to content

Commit

Permalink
add missing separator to local path
Browse files Browse the repository at this point in the history
  • Loading branch information
WinterMute authored and fincs committed May 7, 2023
1 parent a6686ae commit 77c2d18
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nx/source/runtime/devices/fs_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,9 @@ fsdev_fixpath(struct _reent *r,
{
const char* cwd = dev->cwd ? dev->cwd : "/";
strncpy(__nx_dev_path_buf, cwd, PATH_MAX);
__nx_dev_path_buf[PATH_MAX] = '\0';
strncat(__nx_dev_path_buf, path, PATH_MAX - strlen(cwd));
size_t cwdlen = strlen(__nx_dev_path_buf);
strncat(__nx_dev_path_buf, "/", PATH_MAX - cwdlen);
strncat(__nx_dev_path_buf, path, PATH_MAX - cwdlen -1);
}

if(__nx_dev_path_buf[PATH_MAX] != 0)
Expand Down

0 comments on commit 77c2d18

Please sign in to comment.