Skip to content

Commit

Permalink
Merge pull request #67 from rossy/setmode-fix
Browse files Browse the repository at this point in the history
Fix for _setmode usage
  • Loading branch information
lvandeve committed Aug 22, 2015
2 parents d20ea3c + 6bae6bc commit 89cf773
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/zopfli/zopfli_bin.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,13 @@ static void CompressFile(const ZopfliOptions* options,
SaveFile(outfilename, out, outsize);
} else {
size_t i;
/* Windows workaround for stdout output. */
#if _WIN32
/* Windows workaround for stdout output. */
_setmode(_fileno(stdout), _O_BINARY);
#endif
for (i = 0; i < outsize; i++) {
/* Works only if terminal does not convert newlines. */
printf("%c", out[i]);
}
#if _WIN32
_setmode(_fileno(stdout), _O_TEXT);
#endif
}

free(out);
Expand Down

0 comments on commit 89cf773

Please sign in to comment.