Advertisement
Guest User

Untitled

a guest
Dec 4th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bool cr_added = false;
  2. while ((ch = fgetc (infile)) != EOF) {
  3.     if (cr_added && ch == '\r') {
  4.         continue;
  5.     }  
  6.     fputc (ch, outfile);
  7.     if ((cr_added = ch == '\n')) {
  8.         fputc ('\r', outfile);
  9.     }  
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement