forked from Mirror/GodMode9
Fix file corruption when copying dirs to A:/
thanks @ihaveamac for pointing this one out.
This commit is contained in:
parent
ac514669a1
commit
07b06b8552
@ -487,10 +487,9 @@ bool PathMoveCopyRec(char* dest, char* orig, u32* flags, bool move, u8* buffer,
|
||||
char* oname = strrchr(orig, '/');
|
||||
char* dname = dest + strnlen(dest, 255);
|
||||
if (oname == NULL) return false; // not a proper origin path
|
||||
*(dname++) = '/';
|
||||
strncpy(dname, oname++, 256 - (dname - dest));
|
||||
strncpy(dname, oname, 256 - (dname - dest)); // copy name plus preceding '/'
|
||||
bool res = PathMoveCopyRec(dest, orig, flags, move, buffer, bufsiz);
|
||||
*(--dname) = '\0';
|
||||
*dname = '\0';
|
||||
if (!res) break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user