LOG("iPageCount = %i", iPageCount);\r
\r
// Allocate Information Structure\r
- ret = malloc( sizeof(tBinary) + 3*sizeof(Uint)*iPageCount );\r
+ ret = malloc( sizeof(tBinary) + sizeof(tBinaryPage)*iPageCount );\r
// Fill Info Struct\r
ret->Entry = hdr.entrypoint;\r
ret->Base = -1; // Set Base to maximum value\r
if(phtab[i].Type != PT_LOAD) continue;\r
\r
// Find Base\r
- if(phtab[i].VAddr < ret->Base) ret->Base = phtab[i].VAddr;
-\r
- k = 0;\r
+ if(phtab[i].VAddr < ret->Base) ret->Base = phtab[i].VAddr;\r
\r
LOG("phtab[%i] = {VAddr:0x%x,Offset:0x%x,FileSize:0x%x}",\r
i, phtab[i].VAddr, phtab[i].Offset, phtab[i].FileSize);\r
\r
// Get Pages\r
count = ( (phtab[i].VAddr&0xFFF) + phtab[i].FileSize + 0xFFF) >> 12;\r
- for(;k<count;k++)\r
+ for( k = 0; k < count; k ++ )\r
{\r
ret->Pages[j+k].Virtual = phtab[i].VAddr + (k<<12);\r
ret->Pages[j+k].Physical = phtab[i].Offset + (k<<12); // Store the offset in the physical address\r