mirror of
https://github.com/rtlsdrblog/rtl-sdr-blog.git
synced 2024-11-10 04:37:37 +01:00
rtl_sdr: set binary file mode on win32
Signed-off-by: Steve Markgraf <steve@steve-m.de>
This commit is contained in:
parent
c179f860d5
commit
30cf1f3598
@ -26,6 +26,8 @@
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#include <Windows.h>
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
#include "getopt/getopt.h"
|
||||
#endif
|
||||
|
||||
@ -231,6 +233,9 @@ int main(int argc, char **argv)
|
||||
|
||||
if(strcmp(filename, "-") == 0) { /* Write samples to stdout */
|
||||
file = stdout;
|
||||
#ifdef _WIN32
|
||||
_setmode(_fileno(stdin), _O_BINARY);
|
||||
#endif
|
||||
} else {
|
||||
file = fopen(filename, "wb");
|
||||
if (!file) {
|
||||
|
Loading…
Reference in New Issue
Block a user