Skip to content

Commit 77c2d18

Browse files
WinterMutefincs
authored andcommitted
add missing separator to local path
1 parent a6686ae commit 77c2d18

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

nx/source/runtime/devices/fs_dev.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,9 @@ fsdev_fixpath(struct _reent *r,
213213
{
214214
const char* cwd = dev->cwd ? dev->cwd : "/";
215215
strncpy(__nx_dev_path_buf, cwd, PATH_MAX);
216-
__nx_dev_path_buf[PATH_MAX] = '\0';
217-
strncat(__nx_dev_path_buf, path, PATH_MAX - strlen(cwd));
216+
size_t cwdlen = strlen(__nx_dev_path_buf);
217+
strncat(__nx_dev_path_buf, "/", PATH_MAX - cwdlen);
218+
strncat(__nx_dev_path_buf, path, PATH_MAX - cwdlen -1);
218219
}
219220

220221
if(__nx_dev_path_buf[PATH_MAX] != 0)

0 commit comments

Comments
 (0)