* 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:
Alan Modra 2007-10-15 02:00:56 +00:00
parent 5375ec41be
commit 615f314969
4 changed files with 34 additions and 9 deletions

View file

@ -176,7 +176,9 @@ checksum (FILE *file, unsigned char *ptr, int size, int code)
/* Glue on a checksum too. */
ptr[bytes] = ~sum;
fwrite (ptr, bytes + 1, 1, file);
if (fwrite (ptr, bytes + 1, 1, file) != 1)
/* FIXME: Return error status. */
abort ();
}
@ -299,7 +301,10 @@ wr_tr (void)
0x03, /* RL */
0xfd, /* CS */
};
fwrite (b, 1, sizeof (b), file);
if (fwrite (b, sizeof (b), 1, file) != 1)
/* FIXME: Return error status. */
abort ();
}
static void
@ -1452,7 +1457,10 @@ wr_cs (void)
0x00, /* dot */
0xDE /* CS */
};
fwrite (b, 1, sizeof (b), file);
if (fwrite (b, sizeof (b), 1, file) != 1)
/* FIXME: Return error status. */
abort ();
}
/* Write out the SC records for a unit. Create an SC