added error checking

This commit is contained in:
TLINDEN
2013-12-19 16:54:16 +01:00
parent fa317c8dec
commit 69e1d2ee47

View File

@@ -161,6 +161,8 @@ char *pcp_readz85file(FILE *infile) {
while(!feof(infile)) {
if(!fread(&byte, 1, 1, infile))
break;
if(ferror(infile) != 0)
break;
tmp = realloc(input, bufsize + 1);
input = tmp;
memmove(&input[bufsize], byte, 1);