Skip to content

Commit

Permalink
Merge pull request #81 from pornel/fwrite
Browse files Browse the repository at this point in the history
Faster stdout writing
  • Loading branch information
lvandeve authored Jul 7, 2017
2 parents 6818a08 + 033a562 commit 64c6f36
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/zopfli/zopfli_bin.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,11 @@ static void CompressFile(const ZopfliOptions* options,
if (outfilename) {
SaveFile(outfilename, out, outsize);
} else {
size_t i;
#if _WIN32
/* Windows workaround for stdout output. */
_setmode(_fileno(stdout), _O_BINARY);
#endif
for (i = 0; i < outsize; i++) {
printf("%c", out[i]);
}
fwrite(out, 1, outsize, stdout);
}

free(out);
Expand Down

0 comments on commit 64c6f36

Please sign in to comment.