summaryrefslogtreecommitdiff
path: root/tools/mkimage.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mkimage.c')
-rw-r--r--tools/mkimage.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/mkimage.c b/tools/mkimage.c
index 148ee8d..0e83546 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -268,7 +268,7 @@ NXTARG: ;
imagefile = *argv;
if (lflag) {
- ifd = open(imagefile, O_RDONLY);
+ ifd = open(imagefile, O_RDONLY|O_BINARY);
} else {
ifd = open(imagefile, O_RDWR|O_CREAT|O_TRUNC|O_BINARY, 0666);
}
@@ -502,7 +502,7 @@ copy_file (int ifd, const char *datafile, int pad)
fprintf (stderr, "Adding Image %s\n", datafile);
}
- if ((dfd = open(datafile, O_RDONLY)) < 0) {
+ if ((dfd = open(datafile, O_RDONLY|O_BINARY)) < 0) {
fprintf (stderr, "%s: Can't open %s: %s\n",
cmdname, datafile, strerror(errno));
exit (EXIT_FAILURE);