Original Post
Hi!
I have this here:
char* buffer = 0;
// search file in array
for (int i = 0; i < m_files.size(); ++i)
{
if (!strcmp(m_files[i].Name, Filename))
{
// file found in archiv
// resize buffer
unsigned int size = m_files[i].Size;
buffer = (char*) malloc (size);
// go to dataoffset
fseek (m_pFile, m_files[i].DataOffset, SEEK_SET);
// read out of file
fread (buffer, 1, size, m_pFile);
// only for debuging
int a = strlen(buffer);
if (a) a = 0;
}
}
If i run this peace of code with size = 22 then in the end a = 40, but it should also be 22. The buffer contains the correct data, but the last 18 byte there is nonsene.
Could somebody help me?
Thanks, Christian