cbootimage: Add 'b' (binary) flag when using fopen to open a binary file.
Add 'b' (binary) flag when using fopen to open a binary file.
This keeps Windows from expanding \n to \r\n and interpreting
<ctrl>z as end of file. The change is to support a Windows
hosted coreboot build environment.
Signed-off-by: Scott Duplichan <scott@notabs.org>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
diff --git a/src/set.c b/src/set.c
index 0af6686..e8ae3dd 100644
--- a/src/set.c
+++ b/src/set.c
@@ -53,7 +53,7 @@
FILE *fp;
struct stat stats;
- fp = fopen(filename, "r");
+ fp = fopen(filename, "rb");
if (fp == NULL) {
result = 1;
return result;