From e3bbf7b26622f88c9ee828b89b17a4954ac5b864 Mon Sep 17 00:00:00 2001 From: Malcolm Robb Date: Tue, 30 Sep 2014 16:36:56 +0100 Subject: [PATCH] Read Files are binary When replaying recordings, the read files are binary, so the file open needs to reflect this so that spurious end of file characters aren't misinterpreted. --- dump1090.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dump1090.c b/dump1090.c index 3454aa0..f88d03b 100644 --- a/dump1090.c +++ b/dump1090.c @@ -710,7 +710,7 @@ int main(int argc, char **argv) { } else { if (Modes.filename[0] == '-' && Modes.filename[1] == '\0') { Modes.fd = STDIN_FILENO; - } else if ((Modes.fd = open(Modes.filename,O_RDONLY)) == -1) { + } else if ((Modes.fd = open(Modes.filename, (O_RDONLY | O_BINARY))) == -1) { perror("Opening data file"); exit(1); }