summaryrefslogtreecommitdiff
path: root/plugins/YAMN
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/YAMN')
-rw-r--r--plugins/YAMN/src/account.cpp34
-rw-r--r--plugins/YAMN/src/browser/badconnect.cpp4
-rw-r--r--plugins/YAMN/src/browser/mailbrowser.cpp38
-rw-r--r--plugins/YAMN/src/debug.cpp6
-rw-r--r--plugins/YAMN/src/main.cpp14
-rw-r--r--plugins/YAMN/src/proto/pop3/pop3comm.cpp18
-rw-r--r--plugins/YAMN/src/proto/pop3/pop3opt.cpp18
-rw-r--r--plugins/YAMN/src/protoplugin.cpp2
8 files changed, 67 insertions, 67 deletions
diff --git a/plugins/YAMN/src/account.cpp b/plugins/YAMN/src/account.cpp
index a79c650ce7..fa1262c1da 100644
--- a/plugins/YAMN/src/account.cpp
+++ b/plugins/YAMN/src/account.cpp
@@ -224,7 +224,7 @@ DWORD ReadStringFromMemory(char **Parser,wchar_t *End,char **StoreTo,wchar_t *De
Finder=*Parser;
while((*Finder != (wchar_t)0) && (Finder<=End)) Finder++;
- mir_sntprintf(Debug, L"%s: %s,length is %d, remaining %d chars", DebugString, *Parser, Finder-*Parser, End-Finder);
+ mir_snwprintf(Debug, L"%s: %s,length is %d, remaining %d chars", DebugString, *Parser, Finder-*Parser, End-Finder);
MessageBox(NULL,Debug,L"debug",MB_OK);
if (Finder>=End)
return EACC_FILECOMPATIBILITY;
@@ -279,7 +279,7 @@ DWORD ReadStringFromMemoryW(WCHAR **Parser,wchar_t *End,WCHAR **StoreTo,WCHAR *D
Finder=*Parser;
while((*Finder != (WCHAR)0) && (Finder<=(WCHAR *)End)) Finder++;
- mir_sntprintf(Debug, L"%s: %s,length is %d, remaining %d chars", DebugString, *Parser, Finder-*Parser, (WCHAR *)End-Finder);
+ mir_snwprintf(Debug, L"%s: %s,length is %d, remaining %d chars", DebugString, *Parser, Finder-*Parser, (WCHAR *)End-Finder);
MessageBoxW(NULL,Debug,L"debug",MB_OK);
if (Finder>=(WCHAR *)End)
return EACC_FILECOMPATIBILITY;
@@ -335,7 +335,7 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT
if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
#ifdef DEBUG_FILEREAD
- mir_sntprintf(Debug, L"NFlags: %04x, remaining %d chars", Which->Flags, End-*Parser);
+ mir_snwprintf(Debug, L"NFlags: %04x, remaining %d chars", Which->Flags, End-*Parser);
MessageBox(NULL,Debug,L"debug",MB_OK);
#endif
@@ -344,7 +344,7 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT
if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
#ifdef DEBUG_FILEREAD
- mir_sntprintf(Debug, L"PopupB: %04x, remaining %d chars", Which->PopupB, End-*Parser);
+ mir_snwprintf(Debug, L"PopupB: %04x, remaining %d chars", Which->PopupB, End-*Parser);
MessageBox(NULL,Debug,L"debug",MB_OK);
#endif
Which->PopupT = *(COLORREF *)(*Parser);
@@ -352,7 +352,7 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT
if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
#ifdef DEBUG_FILEREAD
- mir_sntprintf(Debug, L"PopupT: %04x, remaining %d chars", Which->PopupT, End-*Parser);
+ mir_snwprintf(Debug, L"PopupT: %04x, remaining %d chars", Which->PopupT, End-*Parser);
MessageBox(NULL,Debug,L"debug",MB_OK);
#endif
Which->PopupTime = *(DWORD *)(*Parser);
@@ -360,7 +360,7 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT
if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
#ifdef DEBUG_FILEREAD
- mir_sntprintf(Debug, L"PopupTime: %04x, remaining %d chars", Which->PopupTime, End-*Parser);
+ mir_snwprintf(Debug, L"PopupTime: %04x, remaining %d chars", Which->PopupTime, End-*Parser);
MessageBox(NULL,Debug,L"debug",MB_OK);
#endif
@@ -510,7 +510,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End)
if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
#ifdef DEBUG_FILEREAD
- mir_sntprintf(Debug, L"Port: %d, remaining %d chars", Which->Server->Port, End-*Parser);
+ mir_snwprintf(Debug, L"Port: %d, remaining %d chars", Which->Server->Port, End-*Parser);
MessageBox(NULL,Debug,L"debug",MB_OK);
#endif
#ifdef DEBUG_FILEREAD
@@ -533,19 +533,19 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End)
if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
#ifdef DEBUG_FILEREAD
- mir_sntprintf(Debug, L"Flags: %04x, remaining %d chars", Which->Flags, End-*Parser);
+ mir_snwprintf(Debug, L"Flags: %04x, remaining %d chars", Which->Flags, End-*Parser);
MessageBox(NULL,Debug,L"debug",MB_OK);
#endif
Which->StatusFlags = *(DWORD *)(*Parser);
(*Parser) += sizeof(DWORD);
#ifdef DEBUG_FILEREAD
- mir_sntprintf(Debug, L"STFlags: %04x, remaining %d chars", Which->StatusFlags, End-*Parser);
+ mir_snwprintf(Debug, L"STFlags: %04x, remaining %d chars", Which->StatusFlags, End-*Parser);
MessageBox(NULL,Debug,L"debug",MB_OK);
#endif
Which->PluginFlags = *(DWORD *)(*Parser);
(*Parser) += sizeof(DWORD);
#ifdef DEBUG_FILEREAD
- mir_sntprintf(Debug, L"PFlags: %04x, remaining %d chars", Which->PluginFlags, End-*Parser);
+ mir_snwprintf(Debug, L"PFlags: %04x, remaining %d chars", Which->PluginFlags, End-*Parser);
MessageBox(NULL,Debug,L"debug",MB_OK);
#endif
@@ -556,7 +556,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End)
if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
#ifdef DEBUG_FILEREAD
- mir_sntprintf(Debug, L"Interval: %d, remaining %d chars", Which->Interval, End-*Parser);
+ mir_snwprintf(Debug, L"Interval: %d, remaining %d chars", Which->Interval, End-*Parser);
MessageBox(NULL,Debug,L"debug",MB_OK);
#endif
@@ -599,7 +599,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End)
if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
#ifdef DEBUG_FILEREAD
- mir_sntprintf(Debug, L"LastChecked: %04x, remaining %d chars", Which->LastChecked, End-*Parser);
+ mir_snwprintf(Debug, L"LastChecked: %04x, remaining %d chars", Which->LastChecked, End-*Parser);
MessageBox(NULL,Debug,L"debug",MB_OK);
#endif
Which->LastSChecked = *(SYSTEMTIME *)(*Parser);
@@ -607,7 +607,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End)
if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
#ifdef DEBUG_FILEREAD
- mir_sntprintf(Debug, L"LastSChecked: %04x, remaining %d chars", Which->LastSChecked, End-*Parser);
+ mir_snwprintf(Debug, L"LastSChecked: %04x, remaining %d chars", Which->LastSChecked, End-*Parser);
MessageBox(NULL,Debug,L"debug",MB_OK);
#endif
Which->LastSynchronised = *(SYSTEMTIME *)(*Parser);
@@ -615,7 +615,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End)
if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
#ifdef DEBUG_FILEREAD
- mir_sntprintf(Debug, L"LastSynchronised: %04x, remaining %d chars", Which->LastSynchronised, End-*Parser);
+ mir_snwprintf(Debug, L"LastSynchronised: %04x, remaining %d chars", Which->LastSynchronised, End-*Parser);
MessageBox(NULL,Debug,L"debug",MB_OK);
#endif
Which->LastMail = *(SYSTEMTIME *)(*Parser);
@@ -623,7 +623,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End)
if (*Parser > End) //WARNING! There's only > at the end of testing
return EACC_FILECOMPATIBILITY;
#ifdef DEBUG_FILEREAD
- mir_sntprintf(Debug, L"LastMail: %04x, remaining %d chars", Which->LastMail, End-*Parser);
+ mir_snwprintf(Debug, L"LastMail: %04x, remaining %d chars", Which->LastMail, End-*Parser);
MessageBox(NULL,Debug,L"debug",MB_OK);
#endif
if (*Parser == End)
@@ -1232,14 +1232,14 @@ void WINAPI GetStatusFcn(HACCOUNT Which, wchar_t *Value)
return;
mir_cslock lck(csAccountStatusCS);
- mir_tstrcpy(Value, Which->Status);
+ mir_wstrcpy(Value, Which->Status);
}
void WINAPI SetStatusFcn(HACCOUNT Which, wchar_t *Value)
{
if (Which != NULL) {
mir_cslock lck(csAccountStatusCS);
- mir_tstrcpy(Which->Status, Value);
+ mir_wstrcpy(Which->Status, Value);
}
WindowList_BroadcastAsync(YAMNVar.MessageWnds, WM_YAMN_CHANGESTATUS, (WPARAM)Which, 0);
diff --git a/plugins/YAMN/src/browser/badconnect.cpp b/plugins/YAMN/src/browser/badconnect.cpp
index d6e4fdf2e6..31cbb57829 100644
--- a/plugins/YAMN/src/browser/badconnect.cpp
+++ b/plugins/YAMN/src/browser/badconnect.cpp
@@ -119,7 +119,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg, UINT msg, WPARAM wParam, LP
BadConnectPopup.PluginWindowProc = BadConnectPopupProc;
BadConnectPopup.PluginData = ActualAccount;
- mir_tstrncpy(BadConnectPopup.lptzContactName, _A2T(ActualAccount->Name), _countof(BadConnectPopup.lptzContactName));
+ mir_wstrncpy(BadConnectPopup.lptzContactName, _A2T(ActualAccount->Name), _countof(BadConnectPopup.lptzContactName));
}
if (ActualAccount->Plugin->Fcn != NULL && ActualAccount->Plugin->Fcn->GetErrorStringWFcnPtr != NULL) {
@@ -257,7 +257,7 @@ void __cdecl BadConnection(void *Param)
nid.hIcon = g_LoadIconEx(3);
nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
nid.uCallbackMessage = WM_YAMN_NOTIFYICON;
- mir_sntprintf(nid.szTip, L"%S%s", ActualAccount->Name, TranslateT(" - connection error"));
+ mir_snwprintf(nid.szTip, L"%S%s", ActualAccount->Name, TranslateT(" - connection error"));
Shell_NotifyIcon(NIM_ADD, &nid);
}
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp
index d768f3e363..2dae05544b 100644
--- a/plugins/YAMN/src/browser/mailbrowser.cpp
+++ b/plugins/YAMN/src/browser/mailbrowser.cpp
@@ -543,7 +543,7 @@ int AddNewMailsToListView(HWND hListView, HACCOUNT ActualAccount, DWORD nflags)
if ((UnicodeHeader.From != NULL) && (UnicodeHeader.FromNick != NULL)) {
size_t size = mir_wstrlen(UnicodeHeader.From) + mir_wstrlen(UnicodeHeader.FromNick) + 4;
FromStr = new WCHAR[size];
- mir_sntprintf(FromStr, size, L"%s <%s>", UnicodeHeader.FromNick, UnicodeHeader.From);
+ mir_snwprintf(FromStr, size, L"%s <%s>", UnicodeHeader.FromNick, UnicodeHeader.From);
FromStrNew = TRUE;
}
else if (UnicodeHeader.From != NULL)
@@ -569,7 +569,7 @@ int AddNewMailsToListView(HWND hListView, HACCOUNT ActualAccount, DWORD nflags)
SendMessage(hListView, LVM_SETITEMTEXT, (WPARAM)item.iItem, (LPARAM)&item);
item.iSubItem = 2;
- mir_sntprintf(SizeStr, L"%d kB", msgq->MailData->Size / 1024);
+ mir_snwprintf(SizeStr, L"%d kB", msgq->MailData->Size / 1024);
item.pszText = SizeStr;
SendMessage(hListView, LVM_SETITEMTEXT, (WPARAM)item.iItem, (LPARAM)&item);
@@ -587,8 +587,8 @@ int AddNewMailsToListView(HWND hListView, HACCOUNT ActualAccount, DWORD nflags)
}
if ((nflags & YAMN_ACC_POP) && (ActualAccount->Flags & YAMN_ACC_POPN) && (msgq->Flags & YAMN_MSG_POPUP) && (msgq->Flags & YAMN_MSG_NEW)) {
- mir_tstrncpy(NewMailPopup.lptzContactName, FromStr, _countof(NewMailPopup.lptzContactName));
- mir_tstrncpy(NewMailPopup.lptzText, UnicodeHeader.Subject, _countof(NewMailPopup.lptzText));
+ mir_wstrncpy(NewMailPopup.lptzContactName, FromStr, _countof(NewMailPopup.lptzContactName));
+ mir_wstrncpy(NewMailPopup.lptzText, UnicodeHeader.Subject, _countof(NewMailPopup.lptzText));
PYAMN_MAILSHOWPARAM MailParam = (PYAMN_MAILSHOWPARAM)malloc(sizeof(YAMN_MAILSHOWPARAM));
if (MailParam) {
@@ -634,7 +634,7 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D
if ((nflags & YAMN_ACC_CONT) && (MN->Real.PopupRun + MN->Virtual.PopupRun)) {
wchar_t tszMsg[250];
- mir_sntprintf(tszMsg, TranslateT("%s : %d new mail message(s), %d total"), _A2T(ActualAccount->Name), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC);
+ mir_snwprintf(tszMsg, TranslateT("%s : %d new mail message(s), %d total"), _A2T(ActualAccount->Name), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC);
if (!(nflags & YAMN_ACC_CONTNOEVENT)) {
CLISTEVENT evt = {};
@@ -673,8 +673,8 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D
NewMailPopup.PluginWindowProc = NewMailPopupProc;
NewMailPopup.PluginData = (void *)0; //multiple popups
- mir_tstrncpy(NewMailPopup.lptzContactName, _A2T(ActualAccount->Name), _countof(NewMailPopup.lptzContactName));
- mir_sntprintf(NewMailPopup.lptzText, TranslateT("%d new mail message(s), %d total"), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC);
+ mir_wstrncpy(NewMailPopup.lptzContactName, _A2T(ActualAccount->Name), _countof(NewMailPopup.lptzContactName));
+ mir_snwprintf(NewMailPopup.lptzText, TranslateT("%d new mail message(s), %d total"), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC);
PUAddPopupT(&NewMailPopup);
}
@@ -704,7 +704,7 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D
nid.hIcon = g_LoadIconEx(2);
nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
nid.uCallbackMessage = WM_YAMN_NOTIFYICON;
- mir_sntprintf(nid.szTip, L"%S %s", ActualAccount->Name, TranslateT("- new mail message(s)"));
+ mir_snwprintf(nid.szTip, L"%S %s", ActualAccount->Name, TranslateT("- new mail message(s)"));
Shell_NotifyIcon(NIM_ADD, &nid);
SetTimer(hDlg, TIMER_FLASHING, 500, NULL);
}
@@ -761,11 +761,11 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D
NoNewMailPopup.PluginWindowProc = NoNewMailPopupProc;
NoNewMailPopup.PluginData = 0; //it's not new mail popup
- mir_tstrncpy(NoNewMailPopup.lptzContactName, _A2T(ActualAccount->Name), _countof(NoNewMailPopup.lptzContactName));
+ mir_wstrncpy(NoNewMailPopup.lptzContactName, _A2T(ActualAccount->Name), _countof(NoNewMailPopup.lptzContactName));
if (MN->Real.PopupSL2NC + MN->Virtual.PopupSL2NC)
- mir_sntprintf(NoNewMailPopup.lptzText, TranslateT("No new mail message, %d spam(s)"), MN->Real.PopupSL2NC + MN->Virtual.PopupSL2NC);
+ mir_snwprintf(NoNewMailPopup.lptzText, TranslateT("No new mail message, %d spam(s)"), MN->Real.PopupSL2NC + MN->Virtual.PopupSL2NC);
else
- mir_tstrncpy(NoNewMailPopup.lptzText, TranslateT("No new mail message"), _countof(NoNewMailPopup.lptzText));
+ mir_wstrncpy(NoNewMailPopup.lptzText, TranslateT("No new mail message"), _countof(NoNewMailPopup.lptzText));
PUAddPopupT(&NoNewMailPopup);
}
@@ -1435,7 +1435,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR
size_t size = (From ? mir_wstrlen(From) : 0) + (Subj ? mir_wstrlen(Subj) : 0) + 4;
title = new WCHAR[size];
if (From && Subj)
- mir_sntprintf(title, size, L"%s (%s)", Subj, From);
+ mir_snwprintf(title, size, L"%s (%s)", Subj, From);
else if (From)
wcsncpy_s(title, size, From, _TRUNCATE);
else if (Subj)
@@ -1562,9 +1562,9 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR
if ((nReturnCmd == 1) && (ListView_GetItemState(hList, courRow, LVIS_SELECTED) == 0)) continue;
ListView_GetItemText(hList, courRow, 0, headname, _countof(headname));
ListView_GetItemText(hList, courRow, 1, headvalue, _countof(headvalue));
- size_t headnamelen = mir_tstrlen(headname);
+ size_t headnamelen = mir_wstrlen(headname);
if (headnamelen) sizeNeeded += 1 + headnamelen;
- sizeNeeded += 3 + mir_tstrlen(headvalue);
+ sizeNeeded += 3 + mir_wstrlen(headvalue);
}
if (sizeNeeded && OpenClipboard(hDlg)) {
EmptyClipboard();
@@ -1575,8 +1575,8 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR
if ((nReturnCmd == 1) && (ListView_GetItemState(hList, courRow, LVIS_SELECTED) == 0)) continue;
ListView_GetItemText(hList, courRow, 0, headname, _countof(headname));
ListView_GetItemText(hList, courRow, 1, headvalue, _countof(headvalue));
- if (mir_tstrlen(headname)) courPos += mir_sntprintf(&buff[courPos], sizeNeeded + 1, L"%s:\t%s\r\n", headname, headvalue);
- else courPos += mir_sntprintf(&buff[courPos], sizeNeeded + 1, L"\t%s\r\n", headvalue);
+ if (mir_wstrlen(headname)) courPos += mir_snwprintf(&buff[courPos], sizeNeeded + 1, L"%s:\t%s\r\n", headname, headvalue);
+ else courPos += mir_snwprintf(&buff[courPos], sizeNeeded + 1, L"\t%s\r\n", headvalue);
}
GlobalUnlock(hData);
@@ -2039,7 +2039,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR
if (Total) {
wchar_t DeleteMsg[1024];
- mir_sntprintf(DeleteMsg, TranslateT("Do you really want to delete %d selected mails?"), Total);
+ mir_snwprintf(DeleteMsg, TranslateT("Do you really want to delete %d selected mails?"), Total);
if (IDOK == MessageBox(hDlg, DeleteMsg, TranslateT("Delete confirmation"), MB_OKCANCEL | MB_ICONWARNING)) {
struct DeleteParam ParamToDeleteMails = { YAMN_DELETEVERSION, ThreadRunningEV, ActualAccount, NULL };
@@ -2243,7 +2243,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR
ListView_GetItemText(hList, courRow, 1, subject, _countof(subject));
ListView_GetItemText(hList, courRow, 2, size, _countof(size));
ListView_GetItemText(hList, courRow, 3, date, _countof(date));
- sizeNeeded += 5 + mir_tstrlen(from) + mir_tstrlen(subject) + mir_tstrlen(size) + mir_tstrlen(date);
+ sizeNeeded += 5 + mir_wstrlen(from) + mir_wstrlen(subject) + mir_wstrlen(size) + mir_wstrlen(date);
}
if (sizeNeeded && OpenClipboard(hDlg)) {
EmptyClipboard();
@@ -2256,7 +2256,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR
ListView_GetItemText(hList, courRow, 1, subject, _countof(subject));
ListView_GetItemText(hList, courRow, 2, size, _countof(size));
ListView_GetItemText(hList, courRow, 3, date, _countof(date));
- courPos += mir_sntprintf(&buff[courPos], sizeNeeded + 1, L"%s\t%s\t%s\t%s\r\n", from, subject, size, date);
+ courPos += mir_snwprintf(&buff[courPos], sizeNeeded + 1, L"%s\t%s\t%s\t%s\r\n", from, subject, size, date);
}
GlobalUnlock(hData);
diff --git a/plugins/YAMN/src/debug.cpp b/plugins/YAMN/src/debug.cpp
index fcf594018d..06644d78ef 100644
--- a/plugins/YAMN/src/debug.cpp
+++ b/plugins/YAMN/src/debug.cpp
@@ -43,21 +43,21 @@ void InitDebug()
InitializeCriticalSection(&FileAccessCS);
#ifdef DEBUG_SYNCHRO
- mir_sntprintf(DebugFileName, DebugSynchroFileName2, DebugUserDirectory);
+ mir_snwprintf(DebugFileName, DebugSynchroFileName2, DebugUserDirectory);
SynchroFile=CreateFile(DebugFileName,GENERIC_WRITE,FILE_SHARE_WRITE|FILE_SHARE_READ,NULL,CREATE_ALWAYS,0,NULL);
DebugLog(SynchroFile,"Synchro debug file created by %s\n",YAMN_VER);
#endif
#ifdef DEBUG_COMM
- mir_sntprintf(DebugFileName, DebugCommFileName2, DebugUserDirectory);
+ mir_snwprintf(DebugFileName, DebugCommFileName2, DebugUserDirectory);
CommFile=CreateFile(DebugFileName,GENERIC_WRITE,FILE_SHARE_WRITE|FILE_SHARE_READ,NULL,CREATE_ALWAYS,0,NULL);
DebugLog(CommFile,"Communication debug file created by %s\n",YAMN_VER);
#endif
#ifdef DEBUG_DECODE
- mir_sntprintf(DebugFileName, DebugDecodeFileName2, DebugUserDirectory);
+ mir_snwprintf(DebugFileName, DebugDecodeFileName2, DebugUserDirectory);
DecodeFile=CreateFile(DebugFileName,GENERIC_WRITE,FILE_SHARE_WRITE|FILE_SHARE_READ,NULL,CREATE_ALWAYS,0,NULL);
DebugLog(DecodeFile,"Decoding kernel debug file created by %s\n",YAMN_VER);
diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp
index 230ee89486..73e21c95af 100644
--- a/plugins/YAMN/src/main.cpp
+++ b/plugins/YAMN/src/main.cpp
@@ -63,7 +63,7 @@ static void GetProfileDirectory(wchar_t *szPath, int cbPath)
{
wchar_t tszOldPath[MAX_PATH];
CallService(MS_DB_GETPROFILEPATHT, _countof(tszOldPath), (LPARAM)tszOldPath);
- mir_tstrcat(tszOldPath, L"\\*.book");
+ mir_wstrcat(tszOldPath, L"\\*.book");
VARST ptszNewPath( L"%miranda_userdata%");
@@ -125,8 +125,8 @@ BOOL CALLBACK EnumSystemCodePagesProc(LPTSTR cpStr)
}
#ifdef _DEBUG
if (!found) {
- mir_tstrcat(unknownCP, info.CodePageName);
- mir_tstrcat(unknownCP, L"\n");
+ mir_wstrcat(unknownCP, info.CodePageName);
+ mir_wstrcat(unknownCP, L"\n");
}
#endif
}
@@ -207,7 +207,7 @@ void WINAPI g_ReleaseIcon( HICON hIcon )
static void LoadPlugins()
{
wchar_t szSearchPath[MAX_PATH];
- mir_sntprintf(szSearchPath, L"%s\\Plugins\\YAMN\\*.dll", szMirandaDir);
+ mir_snwprintf(szSearchPath, L"%s\\Plugins\\YAMN\\*.dll", szMirandaDir);
hDllPlugins = NULL;
@@ -221,15 +221,15 @@ static void LoadPlugins()
continue;
// we have a dot
- int len = (int)mir_tstrlen(fd.cFileName); // find the length of the string
+ int len = (int)mir_wstrlen(fd.cFileName); // find the length of the string
wchar_t* end = fd.cFileName+len; // get a pointer to the NULL
int safe = (end-dot)-1; // figure out how many chars after the dot are "safe", not including NULL
- if ((safe != 3) || (mir_tstrcmpi(dot+1, L"dll") != 0)) //not bound, however the "dll" string should mean only 3 chars are compared
+ if ((safe != 3) || (mir_wstrcmpi(dot+1, L"dll") != 0)) //not bound, however the "dll" string should mean only 3 chars are compared
continue;
wchar_t szPluginPath[MAX_PATH];
- mir_sntprintf(szPluginPath, L"%s\\Plugins\\YAMN\\%s", szMirandaDir, fd.cFileName);
+ mir_snwprintf(szPluginPath, L"%s\\Plugins\\YAMN\\%s", szMirandaDir, fd.cFileName);
HINSTANCE hDll = LoadLibrary(szPluginPath);
if (hDll == NULL)
continue;
diff --git a/plugins/YAMN/src/proto/pop3/pop3comm.cpp b/plugins/YAMN/src/proto/pop3/pop3comm.cpp
index cd8c3121db..9b2d0da53e 100644
--- a/plugins/YAMN/src/proto/pop3/pop3comm.cpp
+++ b/plugins/YAMN/src/proto/pop3/pop3comm.cpp
@@ -269,7 +269,7 @@ int RegisterPOP3Plugin(WPARAM, LPARAM)
if (ERROR_FILE_NOT_FOUND != GetLastError())
{
wchar_t temp[1024] = { 0 };
- mir_sntprintf(temp, L"%s\n%s", TranslateT("Reading file error. File already in use?"), FileName);
+ mir_snwprintf(temp, L"%s\n%s", TranslateT("Reading file error. File already in use?"), FileName);
MessageBox(NULL, temp, TranslateT("YAMN (internal POP3) read error"), MB_OK);
CallService(MS_YAMN_DELETEFILENAME, (WPARAM)FileName, 0);
FileName = NULL;
@@ -344,7 +344,7 @@ DWORD WINAPI WritePOP3Accounts()
DWORD ReturnValue = CallService(MS_YAMN_WRITEACCOUNTS, (WPARAM)POP3Plugin, (LPARAM)FileName);
if (ReturnValue == EACC_SYSTEM) {
wchar_t temp[1024] = { 0 };
- mir_sntprintf(temp, L"%s\n%s", TranslateT("Error while copying data to disk occurred. Is file in use?"), FileName);
+ mir_snwprintf(temp, L"%s\n%s", TranslateT("Error while copying data to disk occurred. Is file in use?"), FileName);
MessageBox(NULL, temp, TranslateT("POP3 plugin - write file error"), MB_OK);
}
@@ -380,7 +380,7 @@ DWORD WINAPI ReadPOP3Options(HACCOUNT Which, char **Parser, char *End)
if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
#ifdef DEBUG_FILEREAD
- mir_sntprintf(Debug, L"CodePage: %d, remaining %d chars", ((HPOP3ACCOUNT)Which)->CP, End-*Parser);
+ mir_snwprintf(Debug, L"CodePage: %d, remaining %d chars", ((HPOP3ACCOUNT)Which)->CP, End-*Parser);
MessageBox(NULL,Debug,L"debug",MB_OK);
#endif
return 0;
@@ -713,7 +713,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
for (NewMsgsPtr = (HYAMNMAIL)NewMails; NewMsgsPtr != NULL; NewMsgsPtr = NewMsgsPtr->Next) {
if (!mir_strcmp(MsgQueuePtr->ID, NewMsgsPtr->ID)) {
wchar_t accstatus[512];
- mir_sntprintf(accstatus, TranslateT("Reading body %s"), NewMsgsPtr->ID);
+ mir_snwprintf(accstatus, TranslateT("Reading body %s"), NewMsgsPtr->ID);
SetAccountStatus(ActualAccount, accstatus);
DataRX = MyClient->Top(MsgQueuePtr->Number, 100);
#ifdef DEBUG_DECODE
@@ -786,7 +786,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
{
BOOL autoretr = (ActualAccount->Flags & YAMN_ACC_BODY) != 0;
DataRX = MyClient->Top(MsgQueuePtr->Number, autoretr ? 100 : 0);
- mir_sntprintf(accstatus, TranslateT("Reading new mail messages (%d%% done)"), 100 * i / msgs);
+ mir_snwprintf(accstatus, TranslateT("Reading new mail messages (%d%% done)"), 100 * i / msgs);
SetAccountStatus(ActualAccount, accstatus);
#ifdef DEBUG_DECODE
@@ -1542,14 +1542,14 @@ wchar_t* WINAPI GetErrorString(DWORD Code)
wchar_t *ErrorString = new wchar_t[ERRORSTR_MAXLEN];
POP3_ERRORCODE *ErrorCode = (POP3_ERRORCODE *)(UINT_PTR)Code;
- mir_sntprintf(ErrorString, ERRORSTR_MAXLEN, TranslateT("Error %d-%d-%d-%d:"), ErrorCode->AppError, ErrorCode->POP3Error, ErrorCode->NetError, ErrorCode->SystemError);
+ mir_snwprintf(ErrorString, ERRORSTR_MAXLEN, TranslateT("Error %d-%d-%d-%d:"), ErrorCode->AppError, ErrorCode->POP3Error, ErrorCode->NetError, ErrorCode->SystemError);
if (ErrorCode->POP3Error)
- mir_sntprintf(ErrorString, ERRORSTR_MAXLEN, L"%s\n%s", ErrorString, TranslateTS(POP3Errors[ErrorCode->POP3Error - 1]));
+ mir_snwprintf(ErrorString, ERRORSTR_MAXLEN, L"%s\n%s", ErrorString, TranslateTS(POP3Errors[ErrorCode->POP3Error - 1]));
if (ErrorCode->NetError) {
if (ErrorCode->SSL)
- mir_sntprintf(ErrorString, ERRORSTR_MAXLEN, L"%s\n%s", ErrorString, TranslateTS(SSLErrors[ErrorCode->NetError - 1]));
+ mir_snwprintf(ErrorString, ERRORSTR_MAXLEN, L"%s\n%s", ErrorString, TranslateTS(SSLErrors[ErrorCode->NetError - 1]));
else
- mir_sntprintf(ErrorString, ERRORSTR_MAXLEN, L"%s\n%s", ErrorString, TranslateTS(NetlibErrors[ErrorCode->NetError - 4]));
+ mir_snwprintf(ErrorString, ERRORSTR_MAXLEN, L"%s\n%s", ErrorString, TranslateTS(NetlibErrors[ErrorCode->NetError - 4]));
}
return ErrorString;
diff --git a/plugins/YAMN/src/proto/pop3/pop3opt.cpp b/plugins/YAMN/src/proto/pop3/pop3opt.cpp
index 4e083211fd..3148158989 100644
--- a/plugins/YAMN/src/proto/pop3/pop3opt.cpp
+++ b/plugins/YAMN/src/proto/pop3/pop3opt.cpp
@@ -650,7 +650,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP
SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_ADDSTRING, 0, (LPARAM)TranslateT("Default"));
for (i = 1; i < CPLENSUPP; i++) {
CPINFOEX info; GetCPInfoEx(CodePageNamesSupp[i].CP, 0, &info);
- size_t len = mir_tstrlen(info.CodePageName + 7);
+ size_t len = mir_wstrlen(info.CodePageName + 7);
info.CodePageName[len + 6] = 0;
SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_ADDSTRING, 0, (LPARAM)(info.CodePageName + 7));
}
@@ -687,7 +687,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP
case WM_YAMN_CHANGETIME:
if ((HPOP3ACCOUNT)wParam == ActualAccount) {
wchar_t Text[256];
- mir_sntprintf(Text, TranslateT("Time left to next check [s]: %d"), (DWORD)lParam);
+ mir_snwprintf(Text, TranslateT("Time left to next check [s]: %d"), (DWORD)lParam);
SetDlgItemText(hDlg, IDC_STTIMELEFT, Text);
}
return TRUE;
@@ -830,7 +830,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP
case IDC_BTNAPP:
{
wchar_t filter[MAX_PATH];
- mir_sntprintf(filter, L"%s (*.exe;*.bat;*.cmd;*.com)%c*.exe;*.bat;*.cmd;*.com%c%s (*.*)%c*.*%c",
+ mir_snwprintf(filter, L"%s (*.exe;*.bat;*.cmd;*.com)%c*.exe;*.bat;*.cmd;*.com%c%s (*.*)%c*.*%c",
TranslateT("Executables"), 0, 0, TranslateT("All Files"), 0, 0);
OPENFILENAME OFNStruct = { 0 };
@@ -1289,12 +1289,12 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
TesterF.lchIcon = g_LoadIconEx(3);
TesterN.lchIcon = g_LoadIconEx(1);
- mir_tstrncpy(Tester.lptzContactName, TranslateT("Account Test"), MAX_CONTACTNAME);
- mir_tstrncpy(TesterF.lptzContactName, TranslateT("Account Test (failed)"), MAX_CONTACTNAME);
- mir_tstrncpy(TesterN.lptzContactName, TranslateT("Account Test"), MAX_CONTACTNAME);
- mir_tstrncpy(Tester.lptzText, TranslateT("You have N new mail messages"), MAX_SECONDLINE);
- mir_tstrncpy(TesterF.lptzText, TranslateT("Connection failed message"), MAX_SECONDLINE);
- mir_tstrncpy(TesterN.lptzText, TranslateT("No new mail message"), MAX_SECONDLINE);
+ mir_wstrncpy(Tester.lptzContactName, TranslateT("Account Test"), MAX_CONTACTNAME);
+ mir_wstrncpy(TesterF.lptzContactName, TranslateT("Account Test (failed)"), MAX_CONTACTNAME);
+ mir_wstrncpy(TesterN.lptzContactName, TranslateT("Account Test"), MAX_CONTACTNAME);
+ mir_wstrncpy(Tester.lptzText, TranslateT("You have N new mail messages"), MAX_SECONDLINE);
+ mir_wstrncpy(TesterF.lptzText, TranslateT("Connection failed message"), MAX_SECONDLINE);
+ mir_wstrncpy(TesterN.lptzText, TranslateT("No new mail message"), MAX_SECONDLINE);
if (TesterC) {
Tester.colorBack = SendDlgItemMessage(hDlg, IDC_CPB, CPM_GETCOLOUR, 0, 0);
Tester.colorText = SendDlgItemMessage(hDlg, IDC_CPT, CPM_GETCOLOUR, 0, 0);
diff --git a/plugins/YAMN/src/protoplugin.cpp b/plugins/YAMN/src/protoplugin.cpp
index 25e7a5a42c..20fc0f5817 100644
--- a/plugins/YAMN/src/protoplugin.cpp
+++ b/plugins/YAMN/src/protoplugin.cpp
@@ -179,7 +179,7 @@ INT_PTR GetFileNameSvc(WPARAM wParam,LPARAM)
if (FileName == NULL)
return NULL;
- mir_sntprintf(FileName, MAX_PATH, L"%s\\yamn-accounts.%s.%s.book", UserDirectory, wParam, ProfileName);
+ mir_snwprintf(FileName, MAX_PATH, L"%s\\yamn-accounts.%s.%s.book", UserDirectory, wParam, ProfileName);
return (INT_PTR)FileName;
}