* objdump.c (print_line): Check fwrite return value.
* srconv.c (checksum, wr_tr, wr_cs): Likewise. * sysdump.c (fillup): Return zero on getc or fread EOF. Return count read.
This commit is contained in:
parent
5375ec41be
commit
615f314969
4 changed files with 34 additions and 9 deletions
|
@ -119,8 +119,15 @@ fillup (unsigned char *ptr)
|
|||
int sum;
|
||||
int i;
|
||||
|
||||
size = getc (file) - 2;
|
||||
fread (ptr, 1, size, file);
|
||||
size = getc (file);
|
||||
if (size == EOF
|
||||
|| size <= 2)
|
||||
return 0;
|
||||
|
||||
size -= 2;
|
||||
if (fread (ptr, size, 1, file) != 1)
|
||||
return 0;
|
||||
|
||||
sum = code + size + 2;
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
|
@ -132,7 +139,7 @@ fillup (unsigned char *ptr)
|
|||
if (dump)
|
||||
dh (ptr, size);
|
||||
|
||||
return size - 1;
|
||||
return size;
|
||||
}
|
||||
|
||||
static barray
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue