games/nes: workaround for truncated chr

front
Sigrid 2020-10-15 10:30:40 +02:00
parent d310da13ba
commit dfbf774bbb
1 changed files with 1 additions and 1 deletions

View File

@ -85,7 +85,7 @@ loadrom(char *file, int sflag)
chr = malloc(nchr * CHRSZ);
if(chr == nil)
sysfatal("malloc: %r");
if(readn(fd, chr, nchr * CHRSZ) < nchr * CHRSZ)
if(readn(fd, chr, nchr * CHRSZ) < 1)
sysfatal("read: %r");
}else{
nchr = 1;