~pixelherodev/zyg

c843bae17984022c2d9a134fa842ef53c114cd7f — Noam Preil 2 months ago 0205ad9
[driver] check fread
2 files changed, 1 insertions(+), 2 deletions(-)

M driver.c
M profile.sh -rw-r--r-- => -rwxr-xr-x
M driver.c => driver.c +1 -2
@@ 335,8 335,7 @@ tests(void)
	if(f == NULL)
		FATAL_EXIT("Failed to open test binary", 0);
	cpu->memory = calloc(65536, 1);
	fread(&((char*)cpu->memory)[0x20], 1, 65536 - 0x20, f);
	if(ferror(f))
	if(fread(&((char*)cpu->memory)[0x20], 1, 65536 - 0x20, f) == 0 || ferror(f))
		FATAL_EXIT("failed to read test binary", 0);
	fclose(f);
	cpu->read_byte = cpu_read;

M profile.sh => profile.sh +0 -0