From eda8a4ef3a211d28b134753dba0d0f29fbab7d1a Mon Sep 17 00:00:00 2001 From: martravi <54960634+martravi@users.noreply.github.com> Date: Sun, 22 Mar 2020 20:42:17 +0100 Subject: [PATCH] fix entries having garbage after their name --- WiiQt/nandbin.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/WiiQt/nandbin.cpp b/WiiQt/nandbin.cpp index 8283c5a..6e1c4aa 100755 --- a/WiiQt/nandbin.cpp +++ b/WiiQt/nandbin.cpp @@ -1227,6 +1227,10 @@ quint16 NandBin::CreateNode( const QString &name, quint32 uid, quint16 gid, quin QByteArray n = name.toLatin1(); n.resize( 12 ); + for(int j = name.size(); j < 12; j++) //zerofill from last character to the last byte + { + n[j] = 0x00; + } //qDebug() << "will add entry for" << n << "at" << hex << i; memcpy( &fsts[ i ].filename, n.data(), 12 ); fsts[ i ].attr = attr;