diff --git a/sys/fs/msdosfs/msdosfs_conv.c b/sys/fs/msdosfs/msdosfs_conv.c index efd219135a1e..8c2d5f40fe54 100644 --- a/sys/fs/msdosfs/msdosfs_conv.c +++ b/sys/fs/msdosfs/msdosfs_conv.c @@ -1249,8 +1249,8 @@ mbnambuf_flush(struct dirent *dp) mbnambuf_init(); return (NULL); } - nambuf_ptr[nambuf_len] = '\0'; memcpy(dp->d_name, nambuf_ptr, nambuf_len); + dp->d_name[nambuf_len] = '\0'; dp->d_namlen = nambuf_len; mbnambuf_init();