diff options
author | Chang S. Bae <chang.seok.bae@intel.com> | 2020-03-24 14:24:43 -0700 |
---|---|---|
committer | Chang S. Bae <chang.seok.bae@intel.com> | 2020-04-22 00:09:58 +0000 |
commit | bd1055b8be048c4b996415a0438f8b48ac766f90 (patch) | |
tree | 595b71d608dd5957db4a37dd5be69505ab6e9980 /include | |
parent | ee8edad40bbc7687752f7987c63b5d9087cf9151 (diff) | |
download | nasm-bd1055b8be048c4b996415a0438f8b48ac766f90.tar.gz |
disam: explicitly change stdin to binary mode
The binary mode has no difference from text mode in
POSIX-compliant operating systems. The two modes are
distinguishable from each other on Windows, and perhaps
on other systems as well.
The binary stream has scalability and other advantages.
Windows treats the standard input stream as text mode by
default. So the code changes it to binary mode.
Also, add a helper function, nasm_set_binary_mode(),
that is OS-agnostic, in the library.
Reported-by: Didier Stevens <didier.stevens@gmail.com>
Suggested-by: Didier Stevens <didier.stevens@gmail.com>
Link: https://bugzilla.nasm.us/show_bug.cgi?id=3392649
Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/nasmlib.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/nasmlib.h b/include/nasmlib.h index 940f1cb7..c4b4ac4c 100644 --- a/include/nasmlib.h +++ b/include/nasmlib.h @@ -365,6 +365,8 @@ enum file_flags { FILE *nasm_open_read(const char *filename, enum file_flags flags); FILE *nasm_open_write(const char *filename, enum file_flags flags); +void nasm_set_binary_mode(FILE *f); + /* Probe for existence of a file */ bool nasm_file_exists(const char *filename); |