Switch to static arrays

This commit is contained in:
Aurora 2016-12-11 19:30:54 +01:00
parent 14162828ea
commit 38088e80e1
2 changed files with 3 additions and 3 deletions

View File

@ -43,14 +43,14 @@ static inline void pathChanger(u8 *pos)
if(pathSize < 6 || pathSize > 57) return; if(pathSize < 6 || pathSize > 57) return;
u8 path[pathSize]; u8 path[57];
fileRead(path, pathFile, pathSize); fileRead(path, pathFile, pathSize);
if(path[pathSize - 1] == 0xA) pathSize--; if(path[pathSize - 1] == 0xA) pathSize--;
if(path[pathSize - 1] == 0xD) pathSize--; if(path[pathSize - 1] == 0xD) pathSize--;
if(pathSize < 6 || pathSize > 57 || path[0] != '/' || memcmp(&path[pathSize - 4], ".bin", 4) != 0) return; if(pathSize < 6 || pathSize > 57 || path[0] != '/' || memcmp(&path[pathSize - 4], ".bin", 4) != 0) return;
u16 finalPath[pathSize + 1]; u16 finalPath[58];
for(u32 i = 0; i < pathSize; i++) for(u32 i = 0; i < pathSize; i++)
finalPath[i] = (u16)path[i]; finalPath[i] = (u16)path[i];

View File

@ -155,7 +155,7 @@ bool verifyPin(u32 pinMode)
if(messageSize > 0 && messageSize <= 800) if(messageSize > 0 && messageSize <= 800)
{ {
char message[messageSize + 1]; char message[801];
if(fileRead(message, messageFile, messageSize) == messageSize) if(fileRead(message, messageFile, messageSize) == messageSize)
{ {