Skip to content

Commit

Permalink
form2hdr: open forms in binary mode
Browse files Browse the repository at this point in the history
otherwise windows will turn every \n into a \r\n tuple, which when
output later gives mixed line endings in the output file.
  • Loading branch information
rofl0r committed Aug 26, 2022
1 parent 909e2fb commit 9065faa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion form2hdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ int main(int argc, char** argv) {
default: usage();
}
unsigned cpl = 77;
FILE *f = fopen(argv[f_arg], "r");
FILE *f = fopen(argv[f_arg], "rb");
if(!f) { perror("fopen"); return 1; }
if(!skip_header(f)) {
fprintf(stderr, "error: form start marker %s not found!\n", "START_INCLUDE");
Expand Down

0 comments on commit 9065faa

Please sign in to comment.