aboutsummaryrefslogtreecommitdiff
path: root/binutils/srconv.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2007-10-15 02:00:56 +0000
committerAlan Modra <amodra@gmail.com>2007-10-15 02:00:56 +0000
commit615f314969111779bdaffaef0e00d13a0efd51f5 (patch)
tree234eaa69ef30f097b5316983ade490b64de93841 /binutils/srconv.c
parent5375ec41bea0ede4ebb4ef8afdc5df82466b3db9 (diff)
downloadgdb-615f314969111779bdaffaef0e00d13a0efd51f5.zip
gdb-615f314969111779bdaffaef0e00d13a0efd51f5.tar.gz
gdb-615f314969111779bdaffaef0e00d13a0efd51f5.tar.bz2
* 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.
Diffstat (limited to 'binutils/srconv.c')
-rw-r--r--binutils/srconv.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/binutils/srconv.c b/binutils/srconv.c
index 914c260..2a7d638 100644
--- a/binutils/srconv.c
+++ b/binutils/srconv.c
@@ -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