Skip to content

Commit 89cf773

Browse files
committed
Merge pull request #67 from rossy/setmode-fix
Fix for _setmode usage
2 parents d20ea3c + 6bae6bc commit 89cf773

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/zopfli/zopfli_bin.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,13 @@ static void CompressFile(const ZopfliOptions* options,
112112
SaveFile(outfilename, out, outsize);
113113
} else {
114114
size_t i;
115-
/* Windows workaround for stdout output. */
116115
#if _WIN32
116+
/* Windows workaround for stdout output. */
117117
_setmode(_fileno(stdout), _O_BINARY);
118118
#endif
119119
for (i = 0; i < outsize; i++) {
120-
/* Works only if terminal does not convert newlines. */
121120
printf("%c", out[i]);
122121
}
123-
#if _WIN32
124-
_setmode(_fileno(stdout), _O_TEXT);
125-
#endif
126122
}
127123

128124
free(out);

0 commit comments

Comments
 (0)