cwfs: don't use sprint() to fill directory name

sprint() will replace invalid utf8 sequences with U+FFFD
which caused directory reads and stats to return the wrong
filename. just strcpy the name bytes.
This commit is contained in:
cinap_lenrek 2015-09-26 11:41:31 +02:00
parent fc06f637cf
commit 76e0968e35

View file

@ -93,7 +93,9 @@ mkdir9p2(Dir* dir, Dentry* dentry, void* strs)
op = p = strs;
dir->name = p;
p += sprint(p, "%s", dentry->name)+1;
strncpy(p, dentry->name, NAMELEN);
p[NAMELEN-1] = 0;
p += strlen(p)+1;
dir->uid = p;
uidtostr(p, dentry->uid, 1);