Skip to content

Commit

Permalink
Fix bug in tools implementation of sprintf() on win32 that occasional…
Browse files Browse the repository at this point in the history
…ly makes it replace \n by \r\n as if it were in text mode.
  • Loading branch information
mgroeber9110 committed Jan 1, 2024
1 parent 08255d2 commit 65e1fb9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Tools/utils/printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,9 +675,9 @@ i_vfprintf(FILE *stream, /* Where to output formatted results. */
* automatically.
*/
#if defined(__HIGHC__) || defined(_MSC_VER) || defined(__WATCOMC__)
if ((c == '\n') && (stream->_flag & _O_BINARY)) {
if (isstrm && (c == '\n') && (stream->_flag & _O_BINARY)) {
#else
if ((c == '\n') && (stream->flags & _F_BIN)) {
if (isstrm && (c == '\n') && (stream->flags & _F_BIN)) {
#endif
i_putc('\r', stream);
}
Expand Down

0 comments on commit 65e1fb9

Please sign in to comment.