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.
This commit is contained in:
Malcolm Robb 2014-09-30 16:36:56 +01:00
parent aa063ba89f
commit e3bbf7b266

View file

@ -710,7 +710,7 @@ int main(int argc, char **argv) {
} else { } else {
if (Modes.filename[0] == '-' && Modes.filename[1] == '\0') { if (Modes.filename[0] == '-' && Modes.filename[1] == '\0') {
Modes.fd = STDIN_FILENO; 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"); perror("Opening data file");
exit(1); exit(1);
} }