View difference between Paste ID: S5kvr22n and fbVLF71R
SHOW: | | - or go back to the newest paste.
1-
bool checknext = false;
1+
bool cr_added = false;
2
while ((ch = fgetc (infile)) != EOF) {
3-
    if (checknext && ch != '\r') {
3+
    if (cr_added && ch == '\r') {
4
        continue;
5
    }  
6
    fputc (ch, outfile);
7-
    checknext = ch == '\n';
7+
    if ((cr_added = ch == '\n')) {
8-
}
8+
9-
9+
10-
if (checknext) {
10+