diff options
-rw-r--r-- | messages.cpp | 8 | ||||
-rw-r--r-- | options.cpp | 4 | ||||
-rw-r--r-- | utilities.cpp | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/messages.cpp b/messages.cpp index 08b7666..18db824 100644 --- a/messages.cpp +++ b/messages.cpp @@ -298,10 +298,10 @@ int RecvMsgSvc(WPARAM w, LPARAM l) wstring path = tmp2; mir_free(tmp2); path += _T("\\decrypted_data"); - fstream f(path.c_str(), std::ios::in | std::ios::ate); + fstream f(path.c_str(), std::ios::in | std::ios::ate | std::ios::binary); if(f.is_open()) { - std::ifstream::pos_type size = f.tellg(); + std::wifstream::pos_type size = f.tellg(); char *tmp = new char [(std::ifstream::pos_type)size+(std::ifstream::pos_type)1]; f.seekg(0, std::ios::beg); f.read(tmp, size); @@ -462,11 +462,11 @@ int SendMsgSvc(WPARAM w, LPARAM l) } DeleteFile(path.c_str()); path.append(_T(".asc")); - wfstream f(path.c_str(), std::ios::in | std::ios::ate); + wfstream f(path.c_str(), std::ios::in | std::ios::ate | std::ios::binary); str.clear(); if(f.is_open()) { - std::ifstream::pos_type size = f.tellg(); + std::wifstream::pos_type size = f.tellg(); TCHAR *tmp = new TCHAR [(std::ifstream::pos_type)size+(std::ifstream::pos_type)1]; f.seekg(0, std::ios::beg); f.read(tmp, size); diff --git a/options.cpp b/options.cpp index 72a0b77..c615cb8 100644 --- a/options.cpp +++ b/options.cpp @@ -1032,7 +1032,7 @@ static BOOL CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LP { break; } - wfstream f(tmp, std::ios::in | std::ios::ate); + wfstream f(tmp, std::ios::in | std::ios::ate | std::ios::binary); delete [] tmp; if(!f.is_open()) { @@ -1041,7 +1041,7 @@ static BOOL CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LP } if(f.is_open()) { - std::ifstream::pos_type size = f.tellg(); + std::wifstream::pos_type size = f.tellg(); TCHAR *tmp = new TCHAR [(std::ifstream::pos_type)size+(std::ifstream::pos_type)1]; f.seekg(0, std::ios::beg); f.read(tmp, size); diff --git a/utilities.cpp b/utilities.cpp index 322541a..c78bc4a 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -476,11 +476,11 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU } DeleteFile(path_out.c_str()); path_out += _T(".asc"); - f.open(path_out.c_str(), std::ios::in | std::ios::ate); + f.open(path_out.c_str(), std::ios::in | std::ios::ate | std::ios::binary); wstring data; if(f.is_open()) { - std::ifstream::pos_type size = f.tellg(); + std::wifstream::pos_type size = f.tellg(); TCHAR *tmp = new TCHAR [(std::ifstream::pos_type)size+(std::ifstream::pos_type)1]; f.seekg(0, std::ios::beg); f.read(tmp, size); |