mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-12 04:22:15 +00:00
NANDImporter: Construct strings correctly
Use std::string(cstring, strnlen(cstring, max_length)) instead of trying to remove extra null characters manually, which is a bit ugly and error prone. And indeed, the original code contained a bug which would cause extra NULLs to not be removed at all if the string did not end with a NULL -- causing issues down the road when constructing paths for sub-entries.
This commit is contained in:
parent
5d449c00e6
commit
7aa083388b
2 changed files with 2 additions and 5 deletions
|
@ -25,7 +25,7 @@ private:
|
|||
#pragma pack(push, 1)
|
||||
struct NANDFSTEntry
|
||||
{
|
||||
u8 name[12];
|
||||
char name[12];
|
||||
u8 mode; // 0x0C
|
||||
u8 attr; // 0x0D
|
||||
u16 sub; // 0x0E
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue