From ec311d78c5917d79663239da7a87ff84ae23d5b2 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 16 Aug 2013 17:08:46 +0000 Subject: [PATCH] Open log files in binary mode. This avoids CRLF translation on Windows. --- ncat/ncat_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ncat/ncat_core.c b/ncat/ncat_core.c index 51af9a813..8332c5b7c 100644 --- a/ncat/ncat_core.c +++ b/ncat/ncat_core.c @@ -459,9 +459,9 @@ int ncat_delay_timer(int delayval) int ncat_openlog(const char *logfile, int append) { if (append) - return Open(logfile, O_WRONLY | O_CREAT | O_APPEND, 0664); + return Open(logfile, O_BINARY | O_WRONLY | O_CREAT | O_APPEND, 0664); else - return Open(logfile, O_WRONLY | O_CREAT | O_TRUNC, 0664); + return Open(logfile, O_BINARY | O_WRONLY | O_CREAT | O_TRUNC, 0664); } static int ncat_hexdump(int logfd, const char *data, int len);