|
@@ -21,6 +21,7 @@
|
|
* MA 02111-1307 USA
|
|
* MA 02111-1307 USA
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
+#include <errno.h>
|
|
#include <stdio.h>
|
|
#include <stdio.h>
|
|
#include <stdint.h>
|
|
#include <stdint.h>
|
|
#include <stdlib.h>
|
|
#include <stdlib.h>
|
|
@@ -114,7 +115,8 @@ int main (int argc, char **argv)
|
|
}
|
|
}
|
|
for (i = start; i != end; i += step)
|
|
for (i = start; i != end; i += step)
|
|
printf("%c", (crc & (0xFF << (i * 8))) >> (i * 8));
|
|
printf("%c", (crc & (0xFF << (i * 8))) >> (i * 8));
|
|
- fwrite(dataptr, 1, datasize, stdout);
|
|
|
|
|
|
+ if (fwrite(dataptr, 1, datasize, stdout) != datasize)
|
|
|
|
+ fprintf(stderr, "fwrite() failed: %s\n", strerror(errno));
|
|
} else {
|
|
} else {
|
|
printf("CRC32 from offset %08X to %08X of environment = %08X\n",
|
|
printf("CRC32 from offset %08X to %08X of environment = %08X\n",
|
|
(unsigned int) (dataptr - envptr),
|
|
(unsigned int) (dataptr - envptr),
|