mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 12:00:56 +01:00
added error checking
This commit is contained in:
@@ -161,6 +161,8 @@ char *pcp_readz85file(FILE *infile) {
|
|||||||
while(!feof(infile)) {
|
while(!feof(infile)) {
|
||||||
if(!fread(&byte, 1, 1, infile))
|
if(!fread(&byte, 1, 1, infile))
|
||||||
break;
|
break;
|
||||||
|
if(ferror(infile) != 0)
|
||||||
|
break;
|
||||||
tmp = realloc(input, bufsize + 1);
|
tmp = realloc(input, bufsize + 1);
|
||||||
input = tmp;
|
input = tmp;
|
||||||
memmove(&input[bufsize], byte, 1);
|
memmove(&input[bufsize], byte, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user