From 36472b00443e23acf28b0dd26ddc2c2e6216d909 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Tue, 9 Dec 2014 00:59:27 +0000 Subject: code cleanup over mir_sntprintf + small bug fix git-svn-id: http://svn.miranda-ng.org/main/trunk@11295 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/PasteIt/src/Options.cpp | 4 ++-- plugins/PasteIt/src/PasteToWeb.cpp | 8 ++++---- plugins/PasteIt/src/PasteToWeb1.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'plugins/PasteIt') diff --git a/plugins/PasteIt/src/Options.cpp b/plugins/PasteIt/src/Options.cpp index ddc20d85e1..d316769fea 100644 --- a/plugins/PasteIt/src/Options.cpp +++ b/plugins/PasteIt/src/Options.cpp @@ -726,7 +726,7 @@ void Options::InitCodepageCB(HWND hwndCB, unsigned int codepage) if(selCpIdx == -1) { TCHAR buf[10]; - mir_sntprintf(buf, 10, _T("%d"), codepage); + mir_sntprintf(buf, SIZEOF(buf), _T("%d"), codepage); ComboBox_SetText(hwndCB, buf); } else @@ -750,7 +750,7 @@ void Options::SetCodepageCB(HWND hwndCB, unsigned int codepage) if(selCpIdx == -1) { TCHAR buf[10]; - mir_sntprintf(buf, 10, _T("%d"), codepage); + mir_sntprintf(buf, SIZEOF(buf), _T("%d"), codepage); ComboBox_SetText(hwndCB, buf); } else diff --git a/plugins/PasteIt/src/PasteToWeb.cpp b/plugins/PasteIt/src/PasteToWeb.cpp index 16ab8b45a0..69871d9cd1 100644 --- a/plugins/PasteIt/src/PasteToWeb.cpp +++ b/plugins/PasteIt/src/PasteToWeb.cpp @@ -386,7 +386,7 @@ void PasteToWeb::FromFile(std::wstring file) { if(fileSize.QuadPart > 512000LL) { - mir_sntprintf(bufErr, 1024, TranslateT("File size is %d KB, do you really want to paste such a large file?"), fileSize.LowPart / 1024); + mir_sntprintf(bufErr, SIZEOF(bufErr), TranslateT("File size is %d KB, do you really want to paste such a large file?"), fileSize.LowPart / 1024); if(MessageBox(NULL, bufErr, TranslateT("Are You sure?"), MB_YESNO | MB_ICONQUESTION) != IDYES) { CloseHandle(hFile); @@ -401,7 +401,7 @@ void PasteToWeb::FromFile(std::wstring file) mir_free(fromFileData.content); fromFileData.content = NULL; fromFileData.contentLen = 0; - mir_sntprintf(bufErr, 1024, TranslateT("Cannot read file '%s'"), file.c_str()); + mir_sntprintf(bufErr, SIZEOF(bufErr), TranslateT("Cannot read file '%s'"), file.c_str()); error = bufErr; } } @@ -415,7 +415,7 @@ void PasteToWeb::FromFile(std::wstring file) } else { - mir_sntprintf(bufErr, 1024, TranslateT("Cannot open file '%s'"), file.c_str()); + mir_sntprintf(bufErr, SIZEOF(bufErr), TranslateT("Cannot open file '%s'"), file.c_str()); error = bufErr; } @@ -493,7 +493,7 @@ void PasteToWeb::FromFile(std::wstring file) } else { - mir_sntprintf(bufErr, 1024, TranslateT("File '%s' is empty"), file.c_str()); + mir_sntprintf(bufErr, SIZEOF(bufErr), TranslateT("File '%s' is empty"), file.c_str()); error = bufErr; } mir_free(fromFileData.content); diff --git a/plugins/PasteIt/src/PasteToWeb1.cpp b/plugins/PasteIt/src/PasteToWeb1.cpp index f1a669c040..ef84d42c4f 100644 --- a/plugins/PasteIt/src/PasteToWeb1.cpp +++ b/plugins/PasteIt/src/PasteToWeb1.cpp @@ -304,7 +304,7 @@ void PasteToWeb1::SendToServer(std::wstring str, std::wstring fileName, std::wst { if(memcmp(L"Bad API request, ", resCont, 17 * sizeof(wchar_t)) == 0) { - mir_sntprintf(bufErr, 1024, TranslateT("Error during sending text to web page: %s"), resCont + 17); + mir_sntprintf(bufErr, SIZEOF(bufErr), TranslateT("Error during sending text to web page: %s"), resCont + 17); error = bufErr; } else @@ -336,7 +336,7 @@ std::wstring PasteToWeb1::GetUserKey(std::wstring& user, std::wstring& password) { if(memcmp(L"Bad API request, ", resCont, 17 * sizeof(wchar_t)) == 0) { - mir_sntprintf(bufErr, 1024, TranslateT("Error during getting user key from web page: %s"), resCont + 17); + mir_sntprintf(bufErr, SIZEOF(bufErr), TranslateT("Error during getting user key from web page: %s"), resCont + 17); MessageBox(NULL, bufErr, TranslateT("Error"), MB_OK | MB_ICONERROR); } else -- cgit v1.2.3