From b6788238b621fbe157e62a61fa7115287233beaa Mon Sep 17 00:00:00 2001 From: Perry Rapp Date: Mon, 12 Jan 2004 01:20:11 +0000 Subject: [PATCH] Fix byte count and argument order when UniStdioFile::WriteString calls fwrite. --- Src/Common/UniFile.cpp | 5 +++-- Src/readme.txt | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Src/Common/UniFile.cpp b/Src/Common/UniFile.cpp index edf061d72..52e42a8ba 100644 --- a/Src/Common/UniFile.cpp +++ b/Src/Common/UniFile.cpp @@ -785,8 +785,9 @@ BOOL UniStdioFile::WriteString(const CString & line) if (m_unicoding == ucr::NONE && m_codepage == ucr::getDefaultCodepage()) #endif { - unsigned int wbytes = fwrite((LPCTSTR)line, line.GetLength(), 1, m_fp); - if (wbytes != line.GetLength() * sizeof(TCHAR)) + unsigned int bytes = line.GetLength() * sizeof(TCHAR); + unsigned int wbytes = fwrite((LPCTSTR)line, 1, bytes, m_fp); + if (wbytes != bytes) return FALSE; return TRUE; } diff --git a/Src/readme.txt b/Src/readme.txt index 5bae4ce9c..855633792 100644 --- a/Src/readme.txt +++ b/Src/readme.txt @@ -1,3 +1,7 @@ +2004-01-11 Perry + Fix byte count and argument order when UniStdioFile::WriteString calls fwrite. + common: UniFile.cpp + 2004-01-11 WinMerge experimental release 2.1.5.5 (cvs) 2004-01-11 Perry -- 2.11.0