Commit d818a02c authored by davidcunado-arm's avatar davidcunado-arm Committed by GitHub
Browse files

Merge pull request #1074 from EvanLloyd/ejll/62_file_mode

fiptool: Update file open modes with 'b' (for Windows)
parents 615cd166 55745dea
...@@ -285,7 +285,7 @@ static int parse_fip(const char *filename, fip_toc_header_t *toc_header_out) ...@@ -285,7 +285,7 @@ static int parse_fip(const char *filename, fip_toc_header_t *toc_header_out)
fip_toc_entry_t *toc_entry; fip_toc_entry_t *toc_entry;
int terminated = 0; int terminated = 0;
fp = fopen(filename, "r"); fp = fopen(filename, "rb");
if (fp == NULL) if (fp == NULL)
log_err("fopen %s", filename); log_err("fopen %s", filename);
...@@ -376,7 +376,7 @@ static image_t *read_image_from_file(const uuid_t *uuid, const char *filename) ...@@ -376,7 +376,7 @@ static image_t *read_image_from_file(const uuid_t *uuid, const char *filename)
assert(uuid != NULL); assert(uuid != NULL);
fp = fopen(filename, "r"); fp = fopen(filename, "rb");
if (fp == NULL) if (fp == NULL)
log_err("fopen %s", filename); log_err("fopen %s", filename);
...@@ -398,7 +398,7 @@ static int write_image_to_file(const image_t *image, const char *filename) ...@@ -398,7 +398,7 @@ static int write_image_to_file(const image_t *image, const char *filename)
{ {
FILE *fp; FILE *fp;
fp = fopen(filename, "w"); fp = fopen(filename, "wb");
if (fp == NULL) if (fp == NULL)
log_err("fopen"); log_err("fopen");
xfwrite(image->buffer, image->toc_e.size, fp, filename); xfwrite(image->buffer, image->toc_e.size, fp, filename);
...@@ -534,7 +534,7 @@ static int pack_images(const char *filename, uint64_t toc_flags, unsigned long a ...@@ -534,7 +534,7 @@ static int pack_images(const char *filename, uint64_t toc_flags, unsigned long a
toc_entry->offset_address = entry_offset; toc_entry->offset_address = entry_offset;
/* Generate the FIP file. */ /* Generate the FIP file. */
fp = fopen(filename, "w"); fp = fopen(filename, "wb");
if (fp == NULL) if (fp == NULL)
log_err("fopen %s", filename); log_err("fopen %s", filename);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment