Account for trailing newlines in .txts

This commit is contained in:
Aurora 2016-09-20 15:16:19 +02:00
parent f228cb241f
commit c8586cfe26
2 changed files with 6 additions and 6 deletions

View File

@ -77,7 +77,7 @@ static void loadCustomVerString(u16 *out, u32 *verStringSize)
{
u64 fileSize;
if(R_SUCCEEDED(IFile_GetSize(&file, &fileSize)) && fileSize <= 60)
if(R_SUCCEEDED(IFile_GetSize(&file, &fileSize)) && fileSize <= 61)
{
u8 buf[fileSize];
u64 total;
@ -159,12 +159,12 @@ static void loadTitleLocaleConfig(u64 progId, u8 *regionId, u8 *languageId)
{
u64 fileSize;
if(R_SUCCEEDED(IFile_GetSize(&file, &fileSize)) && fileSize == 6)
if(R_SUCCEEDED(IFile_GetSize(&file, &fileSize)) && (fileSize == 6 || fileSize == 7))
{
char buf[6];
char buf[fileSize];
u64 total;
if(R_SUCCEEDED(IFile_Read(&file, &total, buf, 6)))
if(R_SUCCEEDED(IFile_Read(&file, &total, buf, fileSize)))
{
for(u32 i = 0; i < 7; i++)
{

View File

@ -484,6 +484,6 @@ void computePinHash(u8 *outbuf, const u8 *inbuf)
sdmmc_get_cid(1, (u32 *)cid);
aes_use_keyslot(4); //Console-unique keyslot whose keys are set by the ARM9 bootROM
aes(cipherText, in, 1, cid, AES_CBC_ENCRYPT_MODE, AES_INPUT_BE | AES_INPUT_NORMAL);
sha(out, cipherText, sizeof(cipherText), SHA_256_MODE);
aes(cipherText, inbuf, 1, cid, AES_CBC_ENCRYPT_MODE, AES_INPUT_BE | AES_INPUT_NORMAL);
sha(outbuf, cipherText, sizeof(cipherText), SHA_256_MODE);
}