ensure __cwd is terminated

This commit is contained in:
Dave Murphy 2018-07-15 22:57:20 +01:00
parent c1e0ea9a6c
commit 61c734fd81

View File

@ -1047,6 +1047,7 @@ fsdev_chdir(struct _reent *r,
if (__cwd[__cwd_len-1] != '/' && __cwd_len < PATH_MAX) if (__cwd[__cwd_len-1] != '/' && __cwd_len < PATH_MAX)
{ {
__cwd[__cwd_len] = '/'; __cwd[__cwd_len] = '/';
__cwd[__cwd_len+1] = '\0';
} }
fsdev_fsdevice_cwd = device->id; fsdev_fsdevice_cwd = device->id;