From c370af60855db957c5b200914bf0bde743845528 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 28 Aug 2015 16:22:41 +0000 Subject: mir_sntprintf / mir_snprintf: obsoleted second parameter removed wherever possible git-svn-id: http://svn.miranda-ng.org/main/trunk@15064 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/stdauth/src/auth.cpp | 10 +++++----- src/core/stdauth/src/authdialogs.cpp | 24 ++++++++++++------------ src/core/stdaway/src/awaymsg.cpp | 6 +++--- src/core/stdaway/src/sendmsg.cpp | 4 ++-- src/core/stdchat/src/main.cpp | 2 +- src/core/stdchat/src/tools.cpp | 2 +- src/core/stdchat/src/window.cpp | 16 ++++++++-------- src/core/stdfile/src/file.cpp | 2 +- src/core/stdfile/src/fileexistsdlg.cpp | 4 ++-- src/core/stdfile/src/fileopts.cpp | 2 +- src/core/stdfile/src/filerecvdlg.cpp | 4 ++-- src/core/stdfile/src/filesenddlg.cpp | 8 ++++---- src/core/stdfile/src/filexferdlg.cpp | 12 ++++++------ src/core/stdhelp/src/about.cpp | 2 +- src/core/stdmsg/src/msgdialog.cpp | 8 ++++---- src/core/stdmsg/src/msglog.cpp | 2 +- src/core/stdmsg/src/msgs.cpp | 8 ++++---- src/core/stdssl/src/netlibssl.cpp | 2 +- src/core/stduihist/src/history.cpp | 4 ++-- src/core/stduserinfo/src/contactinfo.cpp | 10 +++++----- src/core/stduserinfo/src/stdinfo.cpp | 4 ++-- src/core/stduserinfo/src/userinfo.cpp | 4 ++-- src/core/stduseronline/src/useronline.cpp | 2 +- 23 files changed, 71 insertions(+), 71 deletions(-) (limited to 'src/core') diff --git a/src/core/stdauth/src/auth.cpp b/src/core/stdauth/src/auth.cpp index 29297e7426..74c7855d26 100644 --- a/src/core/stdauth/src/auth.cpp +++ b/src/core/stdauth/src/auth.cpp @@ -80,7 +80,7 @@ static int AuthEventAdded(WPARAM, LPARAM lParam) break; case CNFT_DWORD: - mir_sntprintf(szUid, _countof(szUid), _T("%u"), ci.dVal); + mir_sntprintf(szUid, _T("%u"), ci.dVal); break; } } @@ -88,9 +88,9 @@ static int AuthEventAdded(WPARAM, LPARAM lParam) if (dbei.eventType == EVENTTYPE_AUTHREQUEST) { SkinPlaySound("AuthRequest"); if (szUid[0]) - mir_sntprintf(szTooltip, _countof(szTooltip), TranslateT("%s requests authorization"), szUid); + mir_sntprintf(szTooltip, TranslateT("%s requests authorization"), szUid); else - mir_sntprintf(szTooltip, _countof(szTooltip), TranslateT("%u requests authorization"), *(PDWORD)dbei.pBlob); + mir_sntprintf(szTooltip, TranslateT("%u requests authorization"), *(PDWORD)dbei.pBlob); cli.hIcon = Skin_LoadIcon(SKINICON_AUTH_REQUEST); cli.pszService = MS_AUTH_SHOWREQUEST; @@ -99,9 +99,9 @@ static int AuthEventAdded(WPARAM, LPARAM lParam) else if (dbei.eventType == EVENTTYPE_ADDED) { SkinPlaySound("AddedEvent"); if (szUid[0]) - mir_sntprintf(szTooltip, _countof(szTooltip), TranslateT("%s added you to their contact list"), szUid); + mir_sntprintf(szTooltip, TranslateT("%s added you to their contact list"), szUid); else - mir_sntprintf(szTooltip, _countof(szTooltip), TranslateT("%u added you to their contact list"), *(PDWORD)dbei.pBlob); + mir_sntprintf(szTooltip, TranslateT("%u added you to their contact list"), *(PDWORD)dbei.pBlob); cli.hIcon = Skin_LoadIcon(SKINICON_AUTH_ADD); cli.pszService = MS_AUTH_SHOWADDED; diff --git a/src/core/stdauth/src/authdialogs.cpp b/src/core/stdauth/src/authdialogs.cpp index 85b08c1a20..0156498b77 100644 --- a/src/core/stdauth/src/authdialogs.cpp +++ b/src/core/stdauth/src/authdialogs.cpp @@ -63,11 +63,11 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar TCHAR name[128] = _T(""); int off = 0; if (firstT[0] && lastT[0]) - off = mir_sntprintf(name, _countof(name), _T("%s %s"), firstT, lastT); + off = mir_sntprintf(name, _T("%s %s"), firstT, lastT); else if (firstT[0]) - off = mir_sntprintf(name, _countof(name), _T("%s"), firstT); + off = mir_sntprintf(name, _T("%s"), firstT); else if (lastT[0]) - off = mir_sntprintf(name, _countof(name), _T("%s"), lastT); + off = mir_sntprintf(name, _T("%s"), lastT); if (nickT[0]) { if (off) mir_sntprintf(name + off, _countof(name) - off, _T(" (%s)"), nickT); @@ -79,11 +79,11 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar TCHAR hdr[256]; if (uin && emailT[0]) - mir_sntprintf(hdr, _countof(hdr), TranslateT("%s added you to the contact list\n%u (%s) on %s"), name, uin, emailT, acc->tszAccountName); + mir_sntprintf(hdr, TranslateT("%s added you to the contact list\n%u (%s) on %s"), name, uin, emailT, acc->tszAccountName); else if (uin) - mir_sntprintf(hdr, _countof(hdr), TranslateT("%s added you to the contact list\n%u on %s"), name, uin, acc->tszAccountName); + mir_sntprintf(hdr, TranslateT("%s added you to the contact list\n%u on %s"), name, uin, acc->tszAccountName); else - mir_sntprintf(hdr, _countof(hdr), TranslateT("%s added you to the contact list\n%s on %s"), name, emailT[0] ? emailT : TranslateT("(Unknown)"), acc->tszAccountName); + mir_sntprintf(hdr, TranslateT("%s added you to the contact list\n%s on %s"), name, emailT[0] ? emailT : TranslateT("(Unknown)"), acc->tszAccountName); SetDlgItemText(hwndDlg, IDC_HEADERBAR, hdr); @@ -188,11 +188,11 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP TCHAR name[128] = _T(""); int off = 0; if (firstT[0] && lastT[0]) - off = mir_sntprintf(name, _countof(name), _T("%s %s"), (TCHAR*)firstT, (TCHAR*)lastT); + off = mir_sntprintf(name, _T("%s %s"), (TCHAR*)firstT, (TCHAR*)lastT); else if (firstT[0]) - off = mir_sntprintf(name, _countof(name), _T("%s"), (TCHAR*)firstT); + off = mir_sntprintf(name, _T("%s"), (TCHAR*)firstT); else if (lastT[0]) - off = mir_sntprintf(name, _countof(name), _T("%s"), (TCHAR*)lastT); + off = mir_sntprintf(name, _T("%s"), (TCHAR*)lastT); if (mir_tstrlen(nickT)) { if (off) mir_sntprintf(name + off, _countof(name) - off, _T(" (%s)"), (TCHAR*)nickT); @@ -204,11 +204,11 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP TCHAR hdr[256]; if (uin && emailT[0]) - mir_sntprintf(hdr, _countof(hdr), TranslateT("%s requested authorization\n%u (%s) on %s"), name, uin, (TCHAR*)emailT, acc->tszAccountName); + mir_sntprintf(hdr, TranslateT("%s requested authorization\n%u (%s) on %s"), name, uin, (TCHAR*)emailT, acc->tszAccountName); else if (uin) - mir_sntprintf(hdr, _countof(hdr), TranslateT("%s requested authorization\n%u on %s"), name, uin, acc->tszAccountName); + mir_sntprintf(hdr, TranslateT("%s requested authorization\n%u on %s"), name, uin, acc->tszAccountName); else - mir_sntprintf(hdr, _countof(hdr), TranslateT("%s requested authorization\n%s on %s"), name, emailT[0] ? (TCHAR*)emailT : TranslateT("(Unknown)"), acc->tszAccountName); + mir_sntprintf(hdr, TranslateT("%s requested authorization\n%s on %s"), name, emailT[0] ? (TCHAR*)emailT : TranslateT("(Unknown)"), acc->tszAccountName); SetDlgItemText(hwndDlg, IDC_HEADERBAR, hdr); SetDlgItemText(hwndDlg, IDC_REASON, reasonT); diff --git a/src/core/stdaway/src/awaymsg.cpp b/src/core/stdaway/src/awaymsg.cpp index 9c333cef1b..477749441f 100644 --- a/src/core/stdaway/src/awaymsg.cpp +++ b/src/core/stdaway/src/awaymsg.cpp @@ -61,11 +61,11 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP TCHAR *status = pcli->pfnGetStatusModeDescription(dwStatus, 0); GetWindowText(hwndDlg, format, _countof(format)); - mir_sntprintf(str, _countof(str), format, status, contactName); + mir_sntprintf(str, format, status, contactName); SetWindowText(hwndDlg, str); GetDlgItemText(hwndDlg, IDC_RETRIEVING, format, _countof(format)); - mir_sntprintf(str, _countof(str), format, status); + mir_sntprintf(str, format, status); SetDlgItemText(hwndDlg, IDC_RETRIEVING, str); Window_SetProtoIcon_IcoLib(hwndDlg, szProto, dwStatus); @@ -141,7 +141,7 @@ static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM) if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGRECV) { if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(status)) { TCHAR str[128]; - mir_sntprintf(str, _countof(str), TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(status, 0)); + mir_sntprintf(str, TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(status, 0)); Menu_ModifyItem(hAwayMsgMenuItem, str, Skin_LoadProtoIcon(szProto, status), CMIF_NOTOFFLINE); return 0; } diff --git a/src/core/stdaway/src/sendmsg.cpp b/src/core/stdaway/src/sendmsg.cpp index 9fce5c6ef4..ea1589a372 100644 --- a/src/core/stdaway/src/sendmsg.cpp +++ b/src/core/stdaway/src/sendmsg.cpp @@ -226,7 +226,7 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa { TCHAR str[256], format[128]; GetWindowText(hwndDlg, format, _countof(format)); - mir_sntprintf(str, _countof(str), format, pcli->pfnGetStatusModeDescription(dat->statusMode, 0)); + mir_sntprintf(str, format, pcli->pfnGetStatusModeDescription(dat->statusMode, 0)); SetWindowText(hwndDlg, str); } GetDlgItemText(hwndDlg, IDOK, dat->okButtonFormat, _countof(dat->okButtonFormat)); @@ -247,7 +247,7 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa case WM_TIMER: if (--dat->countdown >= 0) { TCHAR str[64]; - mir_sntprintf(str, _countof(str), dat->okButtonFormat, dat->countdown); + mir_sntprintf(str, dat->okButtonFormat, dat->countdown); SetDlgItemText(hwndDlg, IDOK, str); } else { diff --git a/src/core/stdchat/src/main.cpp b/src/core/stdchat/src/main.cpp index a65c523c7b..943ddd594b 100644 --- a/src/core/stdchat/src/main.cpp +++ b/src/core/stdchat/src/main.cpp @@ -471,7 +471,7 @@ STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE * lplpstg) { WCHAR szwName[64]; char szName[64]; - mir_snprintf(szName, _countof(szName), "s%u", nextStgId++); + mir_snprintf(szName, "s%u", nextStgId++); MultiByteToWideChar(CP_ACP, 0, szName, -1, szwName, _countof(szwName)); if (pictStg == NULL) return STG_E_MEDIUMFULL; diff --git a/src/core/stdchat/src/tools.cpp b/src/core/stdchat/src/tools.cpp index 4f721cd819..b8bab73b79 100644 --- a/src/core/stdchat/src/tools.cpp +++ b/src/core/stdchat/src/tools.cpp @@ -135,7 +135,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO if (pszWordText && pszWordText[0]) { TCHAR szMenuText[4096]; - mir_sntprintf(szMenuText, _countof(szMenuText), TranslateT("Look up '%s':"), pszWordText); + mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText); ModifyMenu(*hMenu, 4, MF_STRING | MF_BYPOSITION, 4, szMenuText); } else ModifyMenu(*hMenu, 4, MF_STRING | MF_GRAYED | MF_BYPOSITION, 4, TranslateT("No word to look up")); diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp index 2ad1e6c126..1fae21565d 100644 --- a/src/core/stdchat/src/window.cpp +++ b/src/core/stdchat/src/window.cpp @@ -996,7 +996,7 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO *si } if (tszBuf[0] == 0) - mir_sntprintf(tszBuf, _countof(tszBuf), _T("%s: %s\r\n%s: %s\r\n%s: %s"), + mir_sntprintf(tszBuf, _T("%s: %s\r\n%s: %s\r\n%s: %s"), TranslateT("Nickname"), ui->pszNick, TranslateT("Unique ID"), ui->pszUID, TranslateT("Status"), pci->TM_WordToString(si->pStatuses, ui->Status)); @@ -1149,13 +1149,13 @@ static int RestoreWindowPosition(HWND hwnd, MCONTACT hContact, char * szModule, GetWindowPlacement(hwnd, &wp); char szSettingName[64]; - mir_snprintf(szSettingName, _countof(szSettingName), "%sx", szNamePrefix); + mir_snprintf(szSettingName, "%sx", szNamePrefix); int x = db_get_dw(hContact, szModule, szSettingName, -1); - mir_snprintf(szSettingName, _countof(szSettingName), "%sy", szNamePrefix); + mir_snprintf(szSettingName, "%sy", szNamePrefix); int y = (int)db_get_dw(hContact, szModule, szSettingName, -1); - mir_snprintf(szSettingName, _countof(szSettingName), "%swidth", szNamePrefix); + mir_snprintf(szSettingName, "%swidth", szNamePrefix); int width = db_get_dw(hContact, szModule, szSettingName, -1); - mir_snprintf(szSettingName, _countof(szSettingName), "%sheight", szNamePrefix); + mir_snprintf(szSettingName, "%sheight", szNamePrefix); int height = db_get_dw(hContact, szModule, szSettingName, -1); if (x == -1) @@ -2332,7 +2332,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar USERINFO *ui = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, item); if (ui != NULL) { static TCHAR ptszBuf[1024]; - mir_sntprintf(ptszBuf, _countof(ptszBuf), _T("%s: %s\r\n%s: %s\r\n%s: %s"), + mir_sntprintf(ptszBuf, _T("%s: %s\r\n%s: %s\r\n%s: %s"), TranslateT("Nickname"), ui->pszNick, TranslateT("Unique ID"), ui->pszUID, TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui->Status)); @@ -2451,11 +2451,11 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar _tcsncpy_s(szName, (pInfo->ptszModDispName ? pInfo->ptszModDispName : _A2T(si->pszModule)), _TRUNCATE); ValidateFilename(szName); - mir_sntprintf(szFolder, _countof(szFolder), _T("%s\\%s"), g_Settings.pszLogDir, szName); + mir_sntprintf(szFolder, _T("%s\\%s"), g_Settings.pszLogDir, szName); mir_sntprintf(szName, _T("%s.log"), si->ptszID); ValidateFilename(szName); - mir_sntprintf(szFile, _countof(szFile), _T("%s\\%s"), szFolder, szName); + mir_sntprintf(szFile, _T("%s\\%s"), szFolder, szName); ShellExecute(hwndDlg, _T("open"), szFile, NULL, NULL, SW_SHOW); } } diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 49d6cf72b1..9ba716b21f 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -123,7 +123,7 @@ void PushFileEvent(MCONTACT hContact, MEVENT hdbe, LPARAM lParam) SkinPlaySound("RecvFile"); TCHAR szTooltip[256]; - mir_sntprintf(szTooltip, _countof(szTooltip), TranslateT("File from %s"), pcli->pfnGetContactDisplayName(hContact, 0)); + mir_sntprintf(szTooltip, TranslateT("File from %s"), pcli->pfnGetContactDisplayName(hContact, 0)); cle.ptszTooltip = szTooltip; cle.flags |= CLEF_TCHAR; diff --git a/src/core/stdfile/src/fileexistsdlg.cpp b/src/core/stdfile/src/fileexistsdlg.cpp index ea087b0f24..ef765b56bf 100644 --- a/src/core/stdfile/src/fileexistsdlg.cpp +++ b/src/core/stdfile/src/fileexistsdlg.cpp @@ -37,7 +37,7 @@ static void SetControlToUnixTime(HWND hwndDlg, UINT idCtrl, time_t unixTime) FileTimeToSystemTime(&filetime, &st); GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, szTime, _countof(szTime)); GetDateFormatA(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, szDate, _countof(szDate)); - mir_snprintf(szOutput, _countof(szOutput), "%s %s", szDate, szTime); + mir_snprintf(szOutput, "%s %s", szDate, szTime); SetDlgItemTextA(hwndDlg, idCtrl, szOutput); } @@ -156,7 +156,7 @@ void __cdecl LoadIconsAndTypesThread(void* param) } CharUpper(szExtension); if (fileInfo.szTypeName[0] == '\0') - mir_sntprintf(fileInfo.szTypeName, _countof(fileInfo.szTypeName), TranslateT("%s file"), szExtension); + mir_sntprintf(fileInfo.szTypeName, TranslateT("%s file"), szExtension); SetDlgItemText(info->hwndDlg, IDC_EXISTINGTYPE, fileInfo.szTypeName); SetDlgItemText(info->hwndDlg, IDC_NEWTYPE, fileInfo.szTypeName); SendDlgItemMessage(info->hwndDlg, IDC_EXISTINGICON, STM_SETICON, (WPARAM)fileInfo.hIcon, 0); diff --git a/src/core/stdfile/src/fileopts.cpp b/src/core/stdfile/src/fileopts.cpp index da087ad49f..b58b539f58 100644 --- a/src/core/stdfile/src/fileopts.cpp +++ b/src/core/stdfile/src/fileopts.cpp @@ -127,7 +127,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L if (iScanner >= _countof(virusScanners) || iScanner < 0) break; str[0] = '\0'; if (SRFile_GetRegValue(HKEY_LOCAL_MACHINE, virusScanners[iScanner].szExeRegPath, virusScanners[iScanner].szExeRegValue, szScanExe, _countof(szScanExe))) - mir_sntprintf(str, _countof(str), virusScanners[iScanner].szCommandLine, szScanExe); + mir_sntprintf(str, virusScanners[iScanner].szCommandLine, szScanExe); SetDlgItemText(hwndDlg, IDC_SCANCMDLINE, str); } break; diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp index e8b7cda08c..09d5b16d99 100644 --- a/src/core/stdfile/src/filerecvdlg.cpp +++ b/src/core/stdfile/src/filerecvdlg.cpp @@ -129,7 +129,7 @@ void GetContactReceivedFilesDir(MCONTACT hContact, TCHAR *szDir, int cchDir, BOO if (tszRecvPath) _tcsncpy_s(tszTemp, tszRecvPath, _TRUNCATE); else - mir_sntprintf(tszTemp, _countof(tszTemp), _T("%%mydocuments%%\\%s\\%%userid%%"), TranslateT("My received files")); + mir_sntprintf(tszTemp, _T("%%mydocuments%%\\%s\\%%userid%%"), TranslateT("My received files")); if (hContact) { hContact = db_mc_tryMeta(hContact); @@ -169,7 +169,7 @@ void GetReceivedFilesDir(TCHAR *szDir, int cchDir) if (tszRecvPath) _tcsncpy_s(tszTemp, tszRecvPath, _TRUNCATE); else - mir_sntprintf(tszTemp, _countof(tszTemp), _T("%%mydocuments%%\\%s\\%%userid%%"), TranslateT("My received files")); + mir_sntprintf(tszTemp, _T("%%mydocuments%%\\%s\\%%userid%%"), TranslateT("My received files")); patchDir(tszTemp, _countof(tszTemp)); RemoveInvalidPathChars(tszTemp); diff --git a/src/core/stdfile/src/filesenddlg.cpp b/src/core/stdfile/src/filesenddlg.cpp index f719012644..75d955897b 100644 --- a/src/core/stdfile/src/filesenddlg.cpp +++ b/src/core/stdfile/src/filesenddlg.cpp @@ -49,16 +49,16 @@ static void SetFileListAndSizeControls(HWND hwndDlg, FileDlgData *dat) if (i > 1) { TCHAR szFormat[32]; if (fileCount && dirCount) { - mir_sntprintf(szFormat, _countof(szFormat), _T("%s, %s"), TranslateTS(fileCount == 1 ? _T("%d file") : _T("%d files")), TranslateTS(dirCount == 1 ? _T("%d directory") : _T("%d directories"))); - mir_sntprintf(str, _countof(str), szFormat, fileCount, dirCount); + mir_sntprintf(szFormat, _T("%s, %s"), TranslateTS(fileCount == 1 ? _T("%d file") : _T("%d files")), TranslateTS(dirCount == 1 ? _T("%d directory") : _T("%d directories"))); + mir_sntprintf(str, szFormat, fileCount, dirCount); } else if (fileCount) { mir_tstrcpy(szFormat, TranslateT("%d files")); - mir_sntprintf(str, _countof(str), szFormat, fileCount); + mir_sntprintf(str, szFormat, fileCount); } else { mir_tstrcpy(szFormat, TranslateT("%d directories")); - mir_sntprintf(str, _countof(str), szFormat, dirCount); + mir_sntprintf(str, szFormat, dirCount); } SetDlgItemText(hwndDlg, IDC_FILE, str); } diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp index 1073ce9351..804318123b 100644 --- a/src/core/stdfile/src/filexferdlg.cpp +++ b/src/core/stdfile/src/filexferdlg.cpp @@ -105,7 +105,7 @@ static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info) if (info->szFile[mir_tstrlen(info->szFile) - 1] == '\\') info->szFile[mir_tstrlen(info->szFile) - 1] = '\0'; *pszReplace = 0; - mir_sntprintf(szCmdLine, _countof(szCmdLine), _T("%s\"%s\"%s"), dbv.ptszVal, info->szFile, pszReplace + 2); + mir_sntprintf(szCmdLine, _T("%s\"%s\"%s"), dbv.ptszVal, info->szFile, pszReplace + 2); } else _tcsncpy_s(szCmdLine, dbv.ptszVal, _TRUNCATE); @@ -139,7 +139,7 @@ static void SetFilenameControls(HWND hwndDlg, FileDlgData *dat, PROTOFILETRANSFE if (dat->hIcon) DestroyIcon(dat->hIcon); dat->hIcon = NULL; if (fn && (fts->totalFiles > 1)) { - mir_sntprintf(msg, _countof(msg), _T("%s: %s (%d %s %d)"), + mir_sntprintf(msg, _T("%s: %s (%d %s %d)"), pcli->pfnGetContactDisplayName(fts->hContact, 0), fn, fts->currentFileNumber + 1, TranslateT("of"), fts->totalFiles); @@ -147,7 +147,7 @@ static void SetFilenameControls(HWND hwndDlg, FileDlgData *dat, PROTOFILETRANSFE dat->hIcon = shfi.hIcon; } else if (fn) { - mir_sntprintf(msg, _countof(msg), _T("%s: %s"), pcli->pfnGetContactDisplayName(fts->hContact, 0), fn); + mir_sntprintf(msg, _T("%s: %s"), pcli->pfnGetContactDisplayName(fts->hContact, 0), fn); SHGetFileInfo(fn, FILE_ATTRIBUTE_NORMAL, &shfi, sizeof(shfi), SHGFI_USEFILEATTRIBUTES | SHGFI_ICON | SHGFI_SMALLICON); dat->hIcon = shfi.hIcon; @@ -322,7 +322,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR GetTimeFormat(LOCALE_USER_DEFAULT, TIME_FORCE24HOURFORMAT | TIME_NOTIMEMARKER, &st, NULL, szTime, _countof(szTime)); } - mir_sntprintf(szDisplay, _countof(szDisplay), _T("%s/%s (%s %s)"), szSpeed, TranslateT("sec"), szTime, TranslateT("remaining")); + mir_sntprintf(szDisplay, _T("%s/%s (%s %s)"), szSpeed, TranslateT("sec"), szTime, TranslateT("remaining")); SetDlgItemText(hwndDlg, IDC_ALLSPEED, szDisplay); } break; @@ -596,14 +596,14 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR const unsigned long nextPos = fts->totalBytes ? (BIGI(100) * fts->totalProgress / fts->totalBytes) : 0; if (lastPos != nextPos || firstTime) { SendDlgItemMessage(hwndDlg, IDC_ALLFILESPROGRESS, PBM_SETPOS, nextPos, 0); - mir_sntprintf(str, _countof(str), _T("%u%%"), nextPos); + mir_sntprintf(str, _T("%u%%"), nextPos); SetDlgItemText(hwndDlg, IDC_ALLPRECENTS, str); } int units; GetSensiblyFormattedSize(fts->totalBytes, szSizeTotal, _countof(szSizeTotal), 0, 1, &units); GetSensiblyFormattedSize(fts->totalProgress, szSizeDone, _countof(szSizeDone), units, 0, NULL); - mir_sntprintf(str, _countof(str), _T("%s/%s"), szSizeDone, szSizeTotal); + mir_sntprintf(str, _T("%s/%s"), szSizeDone, szSizeTotal); str2[0] = 0; GetDlgItemText(hwndDlg, IDC_ALLTRANSFERRED, str2, _countof(str2)); if (mir_tstrcmp(str, str2)) diff --git a/src/core/stdhelp/src/about.cpp b/src/core/stdhelp/src/about.cpp index 366a9929f1..272ff76db1 100644 --- a/src/core/stdhelp/src/about.cpp +++ b/src/core/stdhelp/src/about.cpp @@ -51,7 +51,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar CallService(MS_SYSTEM_GETVERSIONTEXT, _countof(productVersion), (LPARAM)productVersion); TCHAR str[64]; - mir_sntprintf(str, _countof(str), STR_VERSION_FORMAT, productVersion); + mir_sntprintf(str, STR_VERSION_FORMAT, productVersion); SetDlgItemText(hwndDlg, IDC_HEADERBAR, str); } ShowWindow(GetDlgItem(hwndDlg, IDC_CREDITSFILE), SW_HIDE); diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index dabe41f5f1..5ed973eab0 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -956,7 +956,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l TCHAR date[64], time[64], fmt[128]; TimeZone_PrintTimeStamp(NULL, dat->lastMessage, _T("d"), date, _countof(date), 0); TimeZone_PrintTimeStamp(NULL, dat->lastMessage, _T("t"), time, _countof(time), 0); - mir_sntprintf(fmt, _countof(fmt), TranslateT("Last message received on %s at %s."), date, time); + mir_sntprintf(fmt, TranslateT("Last message received on %s at %s."), date, time); SendMessage(dat->hwndStatus, SB_SETTEXT, 0, (LPARAM)fmt); } else SendMessage(dat->hwndStatus, SB_SETTEXT, 0, (LPARAM)_T("")); @@ -1051,9 +1051,9 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l TCHAR *szStatus = pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE), 0); if (statusIcon) - mir_sntprintf(newtitle, _countof(newtitle), _T("%s - %s"), contactName, TranslateT("Message session")); + mir_sntprintf(newtitle, _T("%s - %s"), contactName, TranslateT("Message session")); else - mir_sntprintf(newtitle, _countof(newtitle), _T("%s (%s): %s"), contactName, szStatus, TranslateT("Message session")); + mir_sntprintf(newtitle, _T("%s (%s): %s"), contactName, szStatus, TranslateT("Message session")); DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *)wParam; if (!cws || (!mir_strcmp(cws->szModule, dat->szProto) && !mir_strcmp(cws->szSetting, "Status"))) { @@ -1297,7 +1297,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l TCHAR* szContactName = pcli->pfnGetContactDisplayName(dat->hContact, 0); HICON hTyping = Skin_LoadIcon(SKINICON_OTHER_TYPING); - mir_sntprintf(szBuf, _countof(szBuf), TranslateT("%s is typing a message..."), szContactName); + mir_sntprintf(szBuf, TranslateT("%s is typing a message..."), szContactName); dat->nTypeSecs--; SendMessage(dat->hwndStatus, SB_SETTEXT, 0, (LPARAM)szBuf); diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index c459a50fb8..d1ebe85ad0 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -212,7 +212,7 @@ static char *SetToStyle(int style) LOGFONT lf; LoadMsgDlgFont(style, &lf, NULL); - mir_snprintf(szStyle, _countof(szStyle), "\\f%u\\cf%u\\b%d\\i%d\\fs%u", style, style, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / logPixelSY); + mir_snprintf(szStyle, "\\f%u\\cf%u\\b%d\\i%d\\fs%u", style, style, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / logPixelSY); return szStyle; } diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 5436d0d6c6..938669c551 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -94,7 +94,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE); cle.pszService = "SRMsg/ReadMessage"; TCHAR toolTip[256]; - mir_sntprintf(toolTip, _countof(toolTip), TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0)); + mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0)); cle.ptszTooltip = toolTip; CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle); return 0; @@ -165,7 +165,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) SendMessage(hwnd, DM_TYPING, 0, lParam); else if (lParam && (g_dat.flags & SMF_SHOWTYPINGTRAY)) { TCHAR szTip[256]; - mir_sntprintf(szTip, _countof(szTip), TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0)); + mir_sntprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0)); if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && !(g_dat.flags & SMF_SHOWTYPINGCLIST)) { MIRANDASYSTRAYNOTIFY tn = { sizeof(tn) }; @@ -257,7 +257,7 @@ static void RestoreUnreadMessageAlerts(void) else { cle.hContact = hContact; cle.hDbEvent = hDbEvent; - mir_sntprintf(toolTip, _countof(toolTip), TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0)); + mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0)); CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle); } } @@ -516,7 +516,7 @@ STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE * lplpstg) { WCHAR szwName[64]; char szName[64]; - mir_snprintf(szName, _countof(szName), "s%u", nextStgId++); + mir_snprintf(szName, "s%u", nextStgId++); MultiByteToWideChar(CP_ACP, 0, szName, -1, szwName, _countof(szwName)); if (pictStg == NULL) return STG_E_MEDIUMFULL; diff --git a/src/core/stdssl/src/netlibssl.cpp b/src/core/stdssl/src/netlibssl.cpp index 1c5dd33569..8b088867e1 100644 --- a/src/core/stdssl/src/netlibssl.cpp +++ b/src/core/stdssl/src/netlibssl.cpp @@ -84,7 +84,7 @@ static void ReportSslError(SECURITY_STATUS scRet, int line, bool = false) } TCHAR szMsgBuf2[512]; - mir_sntprintf(szMsgBuf2, _countof(szMsgBuf2), _T("SSL connection failure (%x %u): %s"), scRet, line, szMsgBuf); + mir_sntprintf(szMsgBuf2, _T("SSL connection failure (%x %u): %s"), scRet, line, szMsgBuf); char* szMsg = Utf8EncodeT(szMsgBuf2); Netlib_Logf(NULL, szMsg); diff --git a/src/core/stduihist/src/history.cpp b/src/core/stduihist/src/history.cpp index 3b9048a3e1..9f6e104b38 100644 --- a/src/core/stduihist/src/history.cpp +++ b/src/core/stduihist/src/history.cpp @@ -165,7 +165,7 @@ static void FillHistoryThread(void* param) GetObjectSummary(&dbei, str, _countof(str)); if (str[0]) { TimeZone_PrintTimeStamp(NULL, dbei.timestamp, _T("d t"), strdatetime, _countof(strdatetime), 0); - mir_sntprintf(eventText, _countof(eventText), _T("%s: %s"), strdatetime, str); + mir_sntprintf(eventText, _T("%s: %s"), strdatetime, str); i = SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM)eventText); SendMessage(hwndList, LB_SETITEMDATA, i, (LPARAM)hDbEvent); } @@ -208,7 +208,7 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP { TCHAR* contactName, str[200]; contactName = pcli->pfnGetContactDisplayName(hContact, 0); - mir_sntprintf(str, _countof(str), TranslateT("History for %s"), contactName); + mir_sntprintf(str, TranslateT("History for %s"), contactName); SetWindowText(hwndDlg, str); } Window_SetIcon_IcoLib(hwndDlg, SKINICON_OTHER_HISTORY); diff --git a/src/core/stduserinfo/src/contactinfo.cpp b/src/core/stduserinfo/src/contactinfo.cpp index 8a679012cd..c142be091b 100644 --- a/src/core/stduserinfo/src/contactinfo.cpp +++ b/src/core/stduserinfo/src/contactinfo.cpp @@ -115,7 +115,7 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar char szPhone[96], szArea[32], szNumber[64]; GetDlgItemTextA(hwndDlg, IDC_AREA, szArea, _countof(szArea)); GetDlgItemTextA(hwndDlg, IDC_NUMBER, szNumber, _countof(szNumber)); - mir_snprintf(szPhone, _countof(szPhone), "+%u (%s) %s", SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETCURSEL, 0, 0), 0), szArea, szNumber); + mir_snprintf(szPhone, "+%u (%s) %s", SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETCURSEL, 0, 0), 0), szArea, szNumber); noRecursion = 1; SetDlgItemTextA(hwndDlg, IDC_PHONE, szPhone); noRecursion = 0; @@ -284,7 +284,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP break; lvi.pszText = idstr2; - mir_sntprintf(idstr2, _countof(idstr2), _T("%d"), i + 2); + mir_sntprintf(idstr2, _T("%d"), i + 2); } ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi); ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.ptszVal); @@ -298,7 +298,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (db_get_ts(hContact, "UserInfo", idstr, &dbv)) break; lvi.pszText = idstr2; - mir_sntprintf(idstr2, _countof(idstr2), TranslateT("Custom %d"), i + 1); + mir_sntprintf(idstr2, TranslateT("Custom %d"), i + 1); ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi); ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.ptszVal); db_free(&dbv); @@ -359,7 +359,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (db_get_ts(hContact, "UserInfo", idstr, &dbv)) break; lvi.pszText = idstr2; - mir_sntprintf(idstr2, _countof(idstr2), TranslateT("Custom %d"), i + 1); + mir_sntprintf(idstr2, TranslateT("Custom %d"), i + 1); ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi); if (mir_tstrlen(dbv.ptszVal) > 4 && !mir_tstrcmp(dbv.ptszVal + mir_tstrlen(dbv.ptszVal) - 4, _T(" SMS"))) { ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 2, _T("y")); @@ -439,7 +439,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP TCHAR szEmail[256]; if (IsOverEmail(hwndDlg, szEmail, _countof(szEmail))) { TCHAR szExec[264]; - mir_sntprintf(szExec, _countof(szExec), _T("mailto:%s"), szEmail); + mir_sntprintf(szExec, _T("mailto:%s"), szEmail); ShellExecute(hwndDlg, _T("open"), szExec, NULL, NULL, SW_SHOW); break; } diff --git a/src/core/stduserinfo/src/stdinfo.cpp b/src/core/stduserinfo/src/stdinfo.cpp index 1dec08f526..4ebc2726cf 100644 --- a/src/core/stduserinfo/src/stdinfo.cpp +++ b/src/core/stduserinfo/src/stdinfo.cpp @@ -107,7 +107,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule WORD wSave = dbv.wVal; if (wSave == (WORD)-1) { char szSettingName[100]; - mir_snprintf(szSettingName, _countof(szSettingName), "%sName", szSetting); + mir_snprintf(szSettingName, "%sName", szSetting); if (!db_get_ts(hContact, szModule, szSettingName, &dbv)) { ptstr = dbv.ptszVal; unspecified = false; @@ -215,7 +215,7 @@ static INT_PTR CALLBACK SummaryDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_EMAIL))) { TCHAR szExec[264], szEmail[256]; GetDlgItemText(hwndDlg, IDC_EMAIL, szEmail, _countof(szEmail)); - mir_sntprintf(szExec, _countof(szExec), _T("mailto:%s"), szEmail); + mir_sntprintf(szExec, _T("mailto:%s"), szEmail); ShellExecute(hwndDlg, _T("open"), szExec, NULL, NULL, SW_SHOW); } break; diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp index 4ca8f3332d..f6629445bd 100644 --- a/src/core/stduserinfo/src/userinfo.cpp +++ b/src/core/stduserinfo/src/userinfo.cpp @@ -255,7 +255,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP name = pcli->pfnGetContactDisplayName(dat->hContact, 0); GetWindowText(hwndDlg, oldTitle, _countof(oldTitle)); - mir_sntprintf(newTitle, _countof(newTitle), oldTitle, name); + mir_sntprintf(newTitle, oldTitle, name); SetWindowText(hwndDlg, newTitle); ////////////////////////////////////////////////////////////////////// @@ -355,7 +355,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_TIMER: TCHAR str[128]; - mir_sntprintf(str, _countof(str), _T("%.*s%s%.*s"), dat->updateAnimFrame % 10, _T("........."), dat->szUpdating, dat->updateAnimFrame % 10, _T(".........")); + mir_sntprintf(str, _T("%.*s%s%.*s"), dat->updateAnimFrame % 10, _T("........."), dat->szUpdating, dat->updateAnimFrame % 10, _T(".........")); SetDlgItemText(hwndDlg, IDC_UPDATING, str); if (++dat->updateAnimFrame == UPDATEANIMFRAMES) dat->updateAnimFrame = 0; diff --git a/src/core/stduseronline/src/useronline.cpp b/src/core/stduseronline/src/useronline.cpp index 4e916724f4..dc6a5e682b 100644 --- a/src/core/stduseronline/src/useronline.cpp +++ b/src/core/stduseronline/src/useronline.cpp @@ -67,7 +67,7 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) cle.hDbEvent = uniqueEventId++; cle.hIcon = Skin_LoadIcon(SKINICON_OTHER_USERONLINE, false); cle.pszService = "UserOnline/Description"; - mir_sntprintf(tooltip, _countof(tooltip), TranslateT("%s is online"), pcli->pfnGetContactDisplayName(hContact, 0)); + mir_sntprintf(tooltip, TranslateT("%s is online"), pcli->pfnGetContactDisplayName(hContact, 0)); cle.ptszTooltip = tooltip; CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle); IcoLib_ReleaseIcon(cle.hIcon, 0); -- cgit v1.2.3