Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool cr_added = false;
- while ((ch = fgetc (infile)) != EOF) {
- if (cr_added && ch == '\r') {
- continue;
- }
- fputc (ch, outfile);
- if ((cr_added = ch == '\n')) {
- fputc ('\r', outfile);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement