From 44a7a4abaa4b94291b0723c7c3412708fe963598 Mon Sep 17 00:00:00 2001 From: Cecill Etheredge Date: Sun, 26 May 2024 00:59:50 +0200 Subject: [PATCH] fix: WASM fopen should be binary. --- src/wcc/wasm_linker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wcc/wasm_linker.c b/src/wcc/wasm_linker.c index 9eb8f4a41..58fc47445 100644 --- a/src/wcc/wasm_linker.c +++ b/src/wcc/wasm_linker.c @@ -1423,7 +1423,7 @@ bool read_wasm_obj(WasmLinker *linker, const char *filename) { char *ext = get_ext(filename); if (strcasecmp(ext, "o") == 0) { FILE *fp; - if (!is_file(filename) || (fp = fopen(filename, "r")) == NULL) { + if (!is_file(filename) || (fp = fopen(filename, "rb")) == NULL) { fprintf(stderr, "cannot open: %s\n", filename); return false; }