- fixed broken data extracted from GRP

This fixes #13
This commit is contained in:
alexey.lysiuk 2021-08-15 15:00:19 +03:00 committed by Christoph Oelckers
parent 1fa15a9674
commit 56d1e69f30

View file

@ -720,7 +720,7 @@ void GrpExtract(const char* filename, FILE* f)
{ {
buffer.Resize(fileinfo[i].Size); buffer.Resize(fileinfo[i].Size);
fileinfo[i].NameWithZero[12] = '\0'; // Be sure filename is null-terminated fileinfo[i].NameWithZero[12] = '\0'; // Be sure filename is null-terminated
if (fileinfo[i].Size != fread(&buffer[0], 1, fileinfo[i].Size, f)) return; if (buffer.Size() != fread(&buffer[0], 1, buffer.Size(), f)) return;
FILE* fout = fopen(fileinfo[i].NameWithZero, "wb"); FILE* fout = fopen(fileinfo[i].NameWithZero, "wb");
if (fout) if (fout)
{ {