diff options
Diffstat (limited to 'protocols/IcqOscarJ')
22 files changed, 79 insertions, 105 deletions
diff --git a/protocols/IcqOscarJ/src/UI/loginpassword.cpp b/protocols/IcqOscarJ/src/UI/loginpassword.cpp index 5263af17a2..bf6706dc75 100644 --- a/protocols/IcqOscarJ/src/UI/loginpassword.cpp +++ b/protocols/IcqOscarJ/src/UI/loginpassword.cpp @@ -47,7 +47,7 @@ INT_PTR CALLBACK LoginPasswdDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA DWORD dwUin = ppro->getContactUin(NULL);
char pszUIN[MAX_PATH], str[MAX_PATH];
- null_snprintf(pszUIN, 128, ICQTranslateUtfStatic(LPGEN("Enter a password for UIN %u:"), str, MAX_PATH), dwUin);
+ mir_snprintf(pszUIN, 128, ICQTranslateUtfStatic(LPGEN("Enter a password for UIN %u:"), str, MAX_PATH), dwUin);
SetDlgItemTextUtf(hwndDlg, IDC_INSTRUCTION, pszUIN);
SendDlgItemMessage(hwndDlg, IDC_LOGINPW, EM_LIMITTEXT, PASSWORDMAXLEN - 1, 0);
diff --git a/protocols/IcqOscarJ/src/UI/userinfotab.cpp b/protocols/IcqOscarJ/src/UI/userinfotab.cpp index ad4a171bc1..e8a8e01b34 100644 --- a/protocols/IcqOscarJ/src/UI/userinfotab.cpp +++ b/protocols/IcqOscarJ/src/UI/userinfotab.cpp @@ -97,7 +97,7 @@ static void SetValue(CIcqProto* ppro, HWND hwndDlg, int idCtrl, HANDLE hContact, {
char szExtra[80];
- null_snprintf(str, 250, "%d", dbv.wVal);
+ mir_snprintf(str, 250, "%d", dbv.wVal);
pstr = str;
if (hContact && ppro->IsDirectConnectionOpen(hContact, DIRECTCONN_STANDARD, 1))
@@ -123,11 +123,11 @@ static void SetValue(CIcqProto* ppro, HWND hwndDlg, int idCtrl, HANDLE hContact, { // give default name
pXName = ICQTranslateUtf(nameXStatus[bXStatus-1]);
}
- null_snprintf(str, sizeof(str), "%s (%s)", pszStatus, pXName);
+ mir_snprintf(str, sizeof(str), "%s (%s)", pszStatus, pXName);
SAFE_FREE((void**)&pXName);
}
else
- null_snprintf(str, sizeof(str), pszStatus);
+ mir_snprintf(str, sizeof(str), pszStatus);
bUtf = 1;
SAFE_FREE(&pszStatus);
@@ -301,7 +301,7 @@ int CIcqProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) if (!lParam)
{
TCHAR buf[200];
- null_snprintf(buf, SIZEOF(buf), TranslateT("%s Details"), m_tszUserName);
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s Details"), m_tszUserName);
odp.ptszTitle = buf;
odp.position = -1899999999;
diff --git a/protocols/IcqOscarJ/src/changeinfo/dlgproc.cpp b/protocols/IcqOscarJ/src/changeinfo/dlgproc.cpp index 404777aa97..b25fd627dc 100644 --- a/protocols/IcqOscarJ/src/changeinfo/dlgproc.cpp +++ b/protocols/IcqOscarJ/src/changeinfo/dlgproc.cpp @@ -497,7 +497,7 @@ INT_PTR CALLBACK ChangeInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM dat->hUpload[i] = NULL;
for (done = 0, i = 0; i < SIZEOF(dat->hUpload); i++)
done += dat->hUpload[i] == NULL;
- null_snprintf(buf, sizeof(buf), "%s%d%%", ICQTranslateUtfStatic(LPGEN("Upload in progress..."), str, MAX_PATH), 100*done/(SIZEOF(dat->hUpload)));
+ mir_snprintf(buf, sizeof(buf), "%s%d%%", ICQTranslateUtfStatic(LPGEN("Upload in progress..."), str, MAX_PATH), 100*done/(SIZEOF(dat->hUpload)));
SetDlgItemTextUtf(hwndDlg, IDC_UPLOADING, buf);
if (done < SIZEOF(dat->hUpload)) break;
diff --git a/protocols/IcqOscarJ/src/changeinfo/editstring.cpp b/protocols/IcqOscarJ/src/changeinfo/editstring.cpp index 9987ce5223..4f1b33ba46 100644 --- a/protocols/IcqOscarJ/src/changeinfo/editstring.cpp +++ b/protocols/IcqOscarJ/src/changeinfo/editstring.cpp @@ -240,7 +240,7 @@ void ChangeInfoData::BeginStringEdit(int iItem, RECT *rc, int i, WORD wVKey) else if ((setting[i].displayType & LIM_TYPE) == LI_NUMBER)
{
szValue = str;
- null_snprintf(str, sizeof(str), "%d", settingData[i].value );
+ mir_snprintf(str, sizeof(str), "%d", settingData[i].value );
}
else if (settingData[i].value)
{
diff --git a/protocols/IcqOscarJ/src/fam_01service.cpp b/protocols/IcqOscarJ/src/fam_01service.cpp index 3923e813c5..3e5c091ea8 100644 --- a/protocols/IcqOscarJ/src/fam_01service.cpp +++ b/protocols/IcqOscarJ/src/fam_01service.cpp @@ -823,7 +823,7 @@ void CIcqProto::handleServUINSettings(int nPort, serverthread_info *info) // prepare mood id
if (m_bMoodsEnabled && bXStatus && moodXStatus[bXStatus-1] != -1)
- null_snprintf(szMoodData, SIZEOF(szMoodData), "icqmood%d", moodXStatus[bXStatus-1]);
+ mir_snprintf(szMoodData, SIZEOF(szMoodData), "icqmood%d", moodXStatus[bXStatus-1]);
else
szMoodData[0] = '\0';
diff --git a/protocols/IcqOscarJ/src/fam_04message.cpp b/protocols/IcqOscarJ/src/fam_04message.cpp index f43166a10c..d11a36b83a 100644 --- a/protocols/IcqOscarJ/src/fam_04message.cpp +++ b/protocols/IcqOscarJ/src/fam_04message.cpp @@ -2650,7 +2650,7 @@ void CIcqProto::handleRecvServMsgError(BYTE *buf, WORD wLen, WORD wFlags, DWORD case 0x0018: // Not while on AOL
default:
if (pszErrorMessage = (char*)_alloca(256))
- null_snprintf(pszErrorMessage, 256, Translate("SNAC(4.1) SENDMSG Error (x%02x)"), wError);
+ mir_snprintf(pszErrorMessage, 256, Translate("SNAC(4.1) SENDMSG Error (x%02x)"), wError);
break;
}
@@ -2958,7 +2958,7 @@ void CIcqProto::handleTypingNotification(BYTE *buf, WORD wLen, WORD wFlags, DWOR char szMsg[MAX_PATH];
char *nick = NickFromHandleUtf(hContact);
- null_snprintf(szMsg, MAX_PATH, ICQTranslateUtfStatic(LPGEN("Contact \"%s\" has closed the message window."), szFormat, MAX_PATH), nick);
+ mir_snprintf(szMsg, MAX_PATH, ICQTranslateUtfStatic(LPGEN("Contact \"%s\" has closed the message window."), szFormat, MAX_PATH), nick);
ShowPopupMsg(hContact, ICQTranslateUtfStatic(LPGEN("ICQ Note"), szFormat, MAX_PATH), szMsg, LOG_NOTE);
SAFE_FREE((void**)&nick);
diff --git a/protocols/IcqOscarJ/src/fam_13servclist.cpp b/protocols/IcqOscarJ/src/fam_13servclist.cpp index 331fff18ab..e451e63ffc 100644 --- a/protocols/IcqOscarJ/src/fam_13servclist.cpp +++ b/protocols/IcqOscarJ/src/fam_13servclist.cpp @@ -217,7 +217,7 @@ void CIcqProto::handleServCListFam(BYTE *pBuffer, WORD wBufferLength, snac_heade else if (pSnacHeader->wSubtype == ICQ_LISTS_REMOVEFROMLIST)
szChange = "Server removed %u item(s) from list";
- null_snprintf(szLogText, MAX_PATH, szChange, nItems);
+ mir_snprintf(szLogText, MAX_PATH, szChange, nItems);
NetLog_Server("Server sent SNAC(x13,x%02x) - %s", pSnacHeader->wSubtype, szLogText);
}
}
@@ -1487,7 +1487,7 @@ void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wGrou char *nick = NickFromHandleUtf(hContact);
setByte(hContact, "Auth", 0);
- null_snprintf(str, MAX_PATH, ICQTranslateUtfStatic(LPGEN("Contact \"%s\" was authorized in the server list."), msg, MAX_PATH), nick);
+ mir_snprintf(str, MAX_PATH, ICQTranslateUtfStatic(LPGEN("Contact \"%s\" was authorized in the server list."), msg, MAX_PATH), nick);
icq_LogMessage(LOG_WARNING, str);
SAFE_FREE(&nick);
}
@@ -1498,7 +1498,7 @@ void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wGrou char *nick = NickFromHandleUtf(hContact);
setByte(hContact, "Auth", 1);
- null_snprintf(str, MAX_PATH, ICQTranslateUtfStatic(LPGEN("Contact \"%s\" lost its authorization in the server list."), msg, MAX_PATH), nick);
+ mir_snprintf(str, MAX_PATH, ICQTranslateUtfStatic(LPGEN("Contact \"%s\" lost its authorization in the server list."), msg, MAX_PATH), nick);
icq_LogMessage(LOG_WARNING, str);
SAFE_FREE(&nick);
}
@@ -1601,7 +1601,7 @@ void CIcqProto::handleServerCListItemDelete(const char *szRecordName, WORD wGrou char msg[MAX_PATH];
char *nick = NickFromHandleUtf(hContact);
- null_snprintf(str, MAX_PATH, ICQTranslateUtfStatic(LPGEN("User \"%s\" was removed from server list."), msg, MAX_PATH), nick);
+ mir_snprintf(str, MAX_PATH, ICQTranslateUtfStatic(LPGEN("User \"%s\" was removed from server list."), msg, MAX_PATH), nick);
icq_LogMessage(LOG_WARNING, str);
SAFE_FREE(&nick);
}
diff --git a/protocols/IcqOscarJ/src/fam_15icqserver.cpp b/protocols/IcqOscarJ/src/fam_15icqserver.cpp index 15754aac18..3e4a6654ad 100644 --- a/protocols/IcqOscarJ/src/fam_15icqserver.cpp +++ b/protocols/IcqOscarJ/src/fam_15icqserver.cpp @@ -594,7 +594,7 @@ int CIcqProto::parseUserInfoRecord(HANDLE hContact, oscar_tlv *pData, UserInfoRe for (int i = 0; i < nRecordDef; i++) {
char szItemKey[MAX_PATH];
- null_snprintf(szItemKey, MAX_PATH, pRecordDef[i].szDbSetting, nRecords);
+ mir_snprintf(szItemKey, MAX_PATH, pRecordDef[i].szDbSetting, nRecords);
switch (pRecordDef[i].dbType) {
case DBVT_UTF8:
@@ -619,7 +619,7 @@ int CIcqProto::parseUserInfoRecord(HANDLE hContact, oscar_tlv *pData, UserInfoRe for (int i = nRecords; i <= nMaxRecords; i++)
for (int j = 0; j < nRecordDef; j++) {
char szItemKey[MAX_PATH];
- null_snprintf(szItemKey, MAX_PATH, pRecordDef[j].szDbSetting, i);
+ mir_snprintf(szItemKey, MAX_PATH, pRecordDef[j].szDbSetting, i);
delSetting(hContact, szItemKey);
}
diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp index b3f02e8f13..363a9f2884 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.cpp +++ b/protocols/IcqOscarJ/src/icq_avatar.cpp @@ -92,7 +92,7 @@ void CIcqProto::InitAvatars() // check if it does make sense
TCHAR tszPath[MAX_PATH * 2];
- null_snprintf(tszPath, MAX_PATH * 2, _T("%%miranda_avatarcache%%\\%S"), m_szModuleName);
+ mir_sntprintf(tszPath, MAX_PATH * 2, _T("%%miranda_avatarcache%%\\%S"), m_szModuleName);
hAvatarsFolder = FoldersRegisterCustomPathT(LPGEN("Avatars"), m_szModuleName, tszPath, m_tszUserName);
}
@@ -134,7 +134,7 @@ void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, TCHAR *pszDest, if (CallService(MS_FOLDERS_GET_PATH, (WPARAM)hAvatarsFolder, (LPARAM)&fgd))
{
TCHAR *tmpPath = Utils_ReplaceVarsT(_T("%miranda_avatarcache%"));
- null_snprintf(szPath, MAX_PATH * 2, _T("%s\\%S\\"), tmpPath, m_szModuleName);
+ mir_sntprintf(szPath, MAX_PATH * 2, _T("%s\\%S\\"), tmpPath, m_szModuleName);
mir_free(tmpPath);
}
else
diff --git a/protocols/IcqOscarJ/src/icq_clients.cpp b/protocols/IcqOscarJ/src/icq_clients.cpp index 46b504b3cb..cfdc74da93 100644 --- a/protocols/IcqOscarJ/src/icq_clients.cpp +++ b/protocols/IcqOscarJ/src/icq_clients.cpp @@ -34,11 +34,11 @@ const capstr capShortCaps = {0x09, 0x46, 0x00, 0x00, 0x4c, 0x7f, 0x11, 0xd1, 0x8 static const char* makeClientVersion(char *szBuf, const char *szClient, unsigned v1, unsigned v2, unsigned v3, unsigned v4)
{
if (v4)
- null_snprintf(szBuf, 64, "%s%u.%u.%u.%u", szClient, v1, v2, v3, v4);
+ mir_snprintf(szBuf, 64, "%s%u.%u.%u.%u", szClient, v1, v2, v3, v4);
else if (v3)
- null_snprintf(szBuf, 64, "%s%u.%u.%u", szClient, v1, v2, v3);
+ mir_snprintf(szBuf, 64, "%s%u.%u.%u", szClient, v1, v2, v3);
else
- null_snprintf(szBuf, 64, "%s%u.%u", szClient, v1, v2);
+ mir_snprintf(szBuf, 64, "%s%u.%u", szClient, v1, v2);
return szBuf;
}
@@ -248,7 +248,7 @@ const char* CIcqProto::detectUserClient(HANDLE hContact, int nIsICQ, WORD wUserC szClient = "&RQ";
else if (dwFT1 == 0xFFFFF666) {
// this is R&Q (Rapid Edition)
- null_snprintf(szClientBuf, 64, "R&Q %u", (unsigned)dwFT2);
+ mir_snprintf(szClientBuf, 64, "R&Q %u", (unsigned)dwFT2);
szClient = szClientBuf;
}
else if (dwFT1 == 0xFFFFFFAB)
@@ -479,7 +479,7 @@ const char* CIcqProto::detectUserClient(HANDLE hContact, int nIsICQ, WORD wUserC strcpy(szClientBuf, "QIP Infium");
if (dwFT1) {
- null_snprintf(ver, 10, " (%d)", dwFT1);
+ mir_snprintf(ver, 10, " (%d)", dwFT1);
strcat(szClientBuf, ver);
}
if (dwFT2 == 0x0B)
@@ -490,7 +490,7 @@ const char* CIcqProto::detectUserClient(HANDLE hContact, int nIsICQ, WORD wUserC else if (MatchCapability(caps, wLen, &capQip2010, 12)) {
strcpy(szClientBuf, "QIP 2010");
if (dwFT1) {
- null_snprintf(ver, 10, " (%d)", dwFT1);
+ mir_snprintf(ver, 10, " (%d)", dwFT1);
strcat(szClientBuf, ver);
}
@@ -499,7 +499,7 @@ const char* CIcqProto::detectUserClient(HANDLE hContact, int nIsICQ, WORD wUserC else if (MatchCapability(caps, wLen, &capQip2012, 12)) {
strcpy(szClientBuf, "QIP 2012");
if (dwFT1) {
- null_snprintf(ver, 10, " (%d)", dwFT1);
+ mir_snprintf(ver, 10, " (%d)", dwFT1);
strcat(szClientBuf, ver);
}
@@ -511,9 +511,9 @@ const char* CIcqProto::detectUserClient(HANDLE hContact, int nIsICQ, WORD wUserC else
null_strcpy(ver, (char*)(*capId) + 11, 5);
- null_snprintf(szClientBuf, 64, cliQip, ver);
+ mir_snprintf(szClientBuf, 64, cliQip, ver);
if (dwFT1 && dwFT2 == 0x0E) {
- null_snprintf(ver, 10, " (%d%d%d%d)", dwFT1 >> 0x18, (dwFT1 >> 0x10) & 0xFF, (dwFT1 >> 0x08) & 0xFF, dwFT1 & 0xFF);
+ mir_snprintf(ver, 10, " (%d%d%d%d)", dwFT1 >> 0x18, (dwFT1 >> 0x10) & 0xFF, (dwFT1 >> 0x08) & 0xFF, dwFT1 & 0xFF);
strcat(szClientBuf, ver);
}
szClient = szClientBuf;
@@ -534,7 +534,7 @@ const char* CIcqProto::detectUserClient(HANDLE hContact, int nIsICQ, WORD wUserC if (dwFT2 == 0x0FFFF0011 && dwFT3 == 0x1100FFFF && (dwFT1 >> 0x18)) {
char ver[16];
- null_snprintf(ver, 10, " %d.%d", dwFT1 >> 0x18, (dwFT1 >> 0x10) & 0xFF);
+ mir_snprintf(ver, 10, " %d.%d", dwFT1 >> 0x18, (dwFT1 >> 0x10) & 0xFF);
if ((dwFT1 & 0xFF) == 0x0B)
strcat(ver, " Beta");
strcat(szClientBuf, ver);
@@ -946,7 +946,7 @@ const char* CIcqProto::detectUserClient(HANDLE hContact, int nIsICQ, WORD wUserC capstr* capId;
if (capId = MatchCapability(caps, wLen, &capMimPack, 4)) {
char szPack[16];
- null_snprintf(szPack, 16, " [%.12s]", (*capId)+4);
+ mir_snprintf(szPack, 16, " [%.12s]", (*capId)+4);
// make sure client string is not constant
if (szClient != szClientBuf) {
diff --git a/protocols/IcqOscarJ/src/icq_direct.cpp b/protocols/IcqOscarJ/src/icq_direct.cpp index 4893bbc813..075f07122c 100644 --- a/protocols/IcqOscarJ/src/icq_direct.cpp +++ b/protocols/IcqOscarJ/src/icq_direct.cpp @@ -982,7 +982,7 @@ int DecryptDirectPacket(directconnect* dc, PBYTE buf, WORD wLen) char* pszBuf;
- titleLineLen = null_snprintf(szTitleLine, 128, "DECRYPTED\n");
+ titleLineLen = mir_snprintf(szTitleLine, 128, "DECRYPTED\n");
szBuf = (char*)_alloca(titleLineLen + ((wLen+15)>>4) * 76 + 1);
CopyMemory(szBuf, szTitleLine, titleLineLen);
pszBuf = szBuf + titleLineLen;
@@ -990,10 +990,10 @@ int DecryptDirectPacket(directconnect* dc, PBYTE buf, WORD wLen) for (line = 0; ; line += 16)
{
colsInLine = min(16, wLen - line);
- pszBuf += wsprintfA(pszBuf, "%08X: ", line);
+ pszBuf += wsprintfA(pszBuf, "%08X: ", line); //!!!!!!!!!!!!!
for (col = 0; col<colsInLine; col++)
- pszBuf += wsprintfA(pszBuf, "%02X%c", buf[line+col], (col&3)==3 && col!=15?'-':' ');
+ pszBuf += wsprintfA(pszBuf, "%02X%c", buf[line+col], (col&3)==3 && col!=15?'-':' '); //!!!!!!!!!!!!!
for (; col<16; col++)
{
diff --git a/protocols/IcqOscarJ/src/icq_firstrun.cpp b/protocols/IcqOscarJ/src/icq_firstrun.cpp index f92eaf24a0..9a5d6bbe11 100644 --- a/protocols/IcqOscarJ/src/icq_firstrun.cpp +++ b/protocols/IcqOscarJ/src/icq_firstrun.cpp @@ -36,7 +36,7 @@ static void accountLoadDetails(CIcqProto *ppro, HWND hwndDlg) DWORD dwUIN = ppro->getContactUin(NULL);
if (dwUIN)
{
- null_snprintf(pszUIN, 20, "%u", dwUIN);
+ mir_snprintf(pszUIN, 20, "%u", dwUIN);
SetDlgItemTextA(hwndDlg, IDC_UIN, pszUIN);
}
diff --git a/protocols/IcqOscarJ/src/icq_http.cpp b/protocols/IcqOscarJ/src/icq_http.cpp index 3e50db43ed..6e9fedf896 100644 --- a/protocols/IcqOscarJ/src/icq_http.cpp +++ b/protocols/IcqOscarJ/src/icq_http.cpp @@ -54,7 +54,7 @@ int icq_httpGatewayInit(HANDLE hConn, NETLIBOPENCONNECTION *nloc, NETLIBHTTPREQU unpackDWord(&buf, &dwSid2);
unpackDWord(&buf, &dwSid3);
unpackDWord(&buf, &dwSid4);
- null_snprintf(szSid, 33, "%08x%08x%08x%08x", dwSid1, dwSid2, dwSid3, dwSid4);
+ mir_snprintf(szSid, 33, "%08x%08x%08x%08x", dwSid1, dwSid2, dwSid3, dwSid4);
unpackWord(&buf, &wIpLen);
if(nlhr->dataLength < 30 + wIpLen || wIpLen == 0 || wIpLen > sizeof(szHttpServer) - 1)
@@ -73,8 +73,8 @@ int icq_httpGatewayInit(HANDLE hConn, NETLIBOPENCONNECTION *nloc, NETLIBHTTPREQU nlhpi.szHttpGetUrl = szHttpGetUrl;
nlhpi.szHttpPostUrl = szHttpPostUrl;
nlhpi.firstPostSequence = 1;
- null_snprintf(szHttpGetUrl, 300, "http://%s/monitor?sid=%s", szHttpServer, szSid);
- null_snprintf(szHttpPostUrl, 300, "http://%s/data?sid=%s&seq=", szHttpServer, szSid);
+ mir_snprintf(szHttpGetUrl, 300, "http://%s/monitor?sid=%s", szHttpServer, szSid);
+ mir_snprintf(szHttpPostUrl, 300, "http://%s/data?sid=%s&seq=", szHttpServer, szSid);
return CallService(MS_NETLIB_SETHTTPPROXYINFO, (WPARAM)hConn, (LPARAM)&nlhpi);
}
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index aba1581956..d8fc2ebb3b 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -174,7 +174,7 @@ CIcqProto::CIcqProto( const char* aProtoName, const TCHAR* aUserName ) : // Register netlib users
NETLIBUSER nlu = {0};
TCHAR szBuffer[MAX_PATH + 64];
- null_snprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s server connection"), m_tszUserName);
+ mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s server connection"), m_tszUserName);
nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
nlu.ptszDescriptiveName = szBuffer;
@@ -188,8 +188,8 @@ CIcqProto::CIcqProto( const char* aProtoName, const TCHAR* aUserName ) : m_hServerNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
char szP2PModuleName[MAX_PATH];
- null_snprintf(szP2PModuleName, SIZEOF(szP2PModuleName), "%sP2P", m_szModuleName);
- null_snprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s client-to-client connections"), m_tszUserName);
+ mir_snprintf(szP2PModuleName, SIZEOF(szP2PModuleName), "%sP2P", m_szModuleName);
+ mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s client-to-client connections"), m_tszUserName);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_TCHAR;
nlu.ptszDescriptiveName = szBuffer;
nlu.szSettingsModule = szP2PModuleName;
@@ -276,9 +276,9 @@ int CIcqProto::OnModulesLoaded( WPARAM wParam, LPARAM lParam ) char pszSrvGroupsName[MAX_PATH];
char* modules[5] = {0,0,0,0,0};
- null_snprintf(pszP2PName, SIZEOF(pszP2PName), "%sP2P", m_szModuleName);
- null_snprintf(pszGroupsName, SIZEOF(pszGroupsName), "%sGroups", m_szModuleName);
- null_snprintf(pszSrvGroupsName, SIZEOF(pszSrvGroupsName), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(pszP2PName, SIZEOF(pszP2PName), "%sP2P", m_szModuleName);
+ mir_snprintf(pszGroupsName, SIZEOF(pszGroupsName), "%sGroups", m_szModuleName);
+ mir_snprintf(pszSrvGroupsName, SIZEOF(pszSrvGroupsName), "%sSrvGroups", m_szModuleName);
modules[0] = m_szModuleName;
modules[1] = pszP2PName;
modules[2] = pszGroupsName;
@@ -1437,7 +1437,7 @@ HANDLE __cdecl CIcqProto::SendFile( HANDLE hContact, const TCHAR* szDescription, }
else
{
- null_snprintf(szFiles, SIZEOF(szFiles), ICQTranslateUtfStatic("%d Files", tmp, SIZEOF(tmp)), ft->dwFileCount);
+ mir_snprintf(szFiles, SIZEOF(szFiles), ICQTranslateUtfStatic("%d Files", tmp, SIZEOF(tmp)), ft->dwFileCount);
pszFiles = szFiles;
}
@@ -2261,11 +2261,11 @@ int __cdecl CIcqProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l {
char szDbSetting[MAX_PATH];
- null_snprintf(szDbSetting, sizeof(szDbSetting), "%sP2P", m_szModuleName);
+ mir_snprintf(szDbSetting, sizeof(szDbSetting), "%sP2P", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbSetting);
- null_snprintf(szDbSetting, sizeof(szDbSetting), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(szDbSetting, sizeof(szDbSetting), "%sSrvGroups", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbSetting);
- null_snprintf(szDbSetting, sizeof(szDbSetting), "%sGroups", m_szModuleName);
+ mir_snprintf(szDbSetting, sizeof(szDbSetting), "%sGroups", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbSetting);
break;
}
diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp index f76e1b3f72..de62755301 100644 --- a/protocols/IcqOscarJ/src/icq_servlist.cpp +++ b/protocols/IcqOscarJ/src/icq_servlist.cpp @@ -983,7 +983,7 @@ void CIcqProto::LoadServerIDs() int nStart = nServerIDListCount;
char szModule[MAX_PATH];
- null_snprintf(szModule, SIZEOF(szModule), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(szModule, SIZEOF(szModule), "%sSrvGroups", m_szModuleName);
GroupReserveIdsEnumParam param = { this, szModule };
dbces.pfnEnumProc = &GroupReserveIdsEnumProc;
@@ -1352,7 +1352,7 @@ int CIcqProto::IsServerGroupsDefined() char szModule[MAX_PATH];
// flush obsolete linking data
- null_snprintf(szModule, SIZEOF(szModule), "%sGroups", m_szModuleName);
+ mir_snprintf(szModule, SIZEOF(szModule), "%sGroups", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szModule);
iRes = 0; // no groups defined, or older version
@@ -1368,7 +1368,7 @@ void CIcqProto::FlushSrvGroupsCache() {
char szModule[MAX_PATH];
- null_snprintf(szModule, SIZEOF(szModule), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(szModule, SIZEOF(szModule), "%sSrvGroups", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szModule);
}
@@ -1462,7 +1462,7 @@ void CIcqProto::removeGroupPathLinks(WORD wGroupID) char szModule[MAX_PATH];
char* pars[3];
- null_snprintf(szModule, SIZEOF(szModule), "%sGroups", m_szModuleName);
+ mir_snprintf(szModule, SIZEOF(szModule), "%sGroups", m_szModuleName);
pars[0] = NULL;
pars[1] = (char*)wGroupID;
@@ -1500,7 +1500,7 @@ char *CIcqProto::getServListGroupName(WORD wGroupID) return NULL;
}
- null_snprintf(szModule, SIZEOF(szModule), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(szModule, SIZEOF(szModule), "%sSrvGroups", m_szModuleName);
_itoa(wGroupID, szGroup, 0x10);
if (!CheckServerID(wGroupID, 0))
@@ -1525,7 +1525,7 @@ void CIcqProto::setServListGroupName(WORD wGroupID, const char *szGroupName) return;
}
- null_snprintf(szModule, SIZEOF(szModule), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(szModule, SIZEOF(szModule), "%sSrvGroups", m_szModuleName);
_itoa(wGroupID, szGroup, 0x10);
if (szGroupName)
@@ -1544,7 +1544,7 @@ WORD CIcqProto::getServListGroupLinkID(const char *szPath) char szModule[MAX_PATH];
WORD wGroupId;
- null_snprintf(szModule, SIZEOF(szModule), "%sGroups", m_szModuleName);
+ mir_snprintf(szModule, SIZEOF(szModule), "%sGroups", m_szModuleName);
wGroupId = db_get_w(NULL, szModule, szPath, 0);
@@ -1563,7 +1563,7 @@ void CIcqProto::setServListGroupLinkID(const char *szPath, WORD wGroupID) {
char szModule[MAX_PATH];
- null_snprintf(szModule, SIZEOF(szModule), "%sGroups", m_szModuleName);
+ mir_snprintf(szModule, SIZEOF(szModule), "%sGroups", m_szModuleName);
if (wGroupID)
db_set_w(NULL, szModule, szPath, wGroupID);
@@ -1798,7 +1798,7 @@ char* CIcqProto::getServListUniqueGroupName(const char *szGroupName, int bAlloce szGroupNameBase = null_strdup(szGroupName);
null_strcut(szGroupNameBase, m_wServerListRecordNameMaxLength);
- null_snprintf(szModule, SIZEOF(szModule), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(szModule, SIZEOF(szModule), "%sSrvGroups", m_szModuleName);
do {
pars[0] = (char*)this;
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp index cbd548094f..255cfb161c 100644 --- a/protocols/IcqOscarJ/src/icq_xstatus.cpp +++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp @@ -60,7 +60,7 @@ DWORD CIcqProto::sendXStatusDetailsRequest(HANDLE hContact, int bForced) int nNotifyLen = 94 + UINMAXLEN;
char *szNotify = (char*)_alloca(nNotifyLen);
- null_snprintf(szNotify, nNotifyLen, "<srv><id>cAwaySrv</id><req><id>AwayStat</id><trans>1</trans><senderId>%d</senderId></req></srv>", m_dwLocalUIN);
+ mir_snprintf(szNotify, nNotifyLen, "<srv><id>cAwaySrv</id><req><id>AwayStat</id><trans>1</trans><senderId>%d</senderId></req></srv>", m_dwLocalUIN);
dwCookie = SendXtrazNotifyRequest(hContact, "<Q><PluginID>srvMng</PluginID></Q>", szNotify, bForced);
}
@@ -417,7 +417,7 @@ void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, HANDLE hContact, BYT null_strcpy(szMoodData, moods, moodsize);
if (moodXStatus[i] == -1) continue;
- null_snprintf(szMoodId, SIZEOF(szMoodId), "0icqmood%d", moodXStatus[i]);
+ mir_snprintf(szMoodId, SIZEOF(szMoodId), "0icqmood%d", moodXStatus[i]);
if ( !strcmpnull(szMoodId, szMoodData)) {
BYTE bXStatusId = (BYTE)(i+1);
char str[MAX_PATH];
@@ -509,7 +509,7 @@ void CIcqProto::updateServerCustomStatus(int fullUpdate) // prepare mood id
if (m_bMoodsEnabled && bXStatus && moodXStatus[bXStatus-1] != -1)
- null_snprintf(szMoodData, SIZEOF(szMoodData), "0icqmood%d", moodXStatus[bXStatus-1]);
+ mir_snprintf(szMoodData, SIZEOF(szMoodData), "0icqmood%d", moodXStatus[bXStatus-1]);
else
szMoodData[0] = '\0';
@@ -703,7 +703,7 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara char buf[MAX_PATH];
char *format = GetWindowTextUtf(hwndDlg);
- null_snprintf(str, sizeof(str), format, dat->bXStatus?ICQTranslateUtfStatic(nameXStatus[dat->bXStatus-1], buf, MAX_PATH):"");
+ mir_snprintf(str, sizeof(str), format, dat->bXStatus?ICQTranslateUtfStatic(nameXStatus[dat->bXStatus-1], buf, MAX_PATH):"");
SetWindowTextUtf(hwndDlg, str);
SAFE_FREE(&format);
}
@@ -715,7 +715,7 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara break;
}
- null_snprintf(str,sizeof(str),dat->okButtonFormat,dat->countdown);
+ mir_snprintf(str,sizeof(str),dat->okButtonFormat,dat->countdown);
SetDlgItemTextUtf(hwndDlg,IDOK,str);
dat->countdown--;
break;
@@ -741,14 +741,14 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara dat->ppro->setByte(DBSETTING_XSTATUS_ID, dat->bXStatus);
char *szValue = GetDlgItemTextUtf(hwndDlg,IDC_XMSG);
- null_snprintf(szSetting, 64, "XStatus%dMsg", dat->bXStatus);
+ mir_snprintf(szSetting, 64, "XStatus%dMsg", dat->bXStatus);
db_set_utf(NULL, dat->ppro->m_szModuleName, szSetting, szValue);
db_set_utf(NULL, dat->ppro->m_szModuleName, DBSETTING_XSTATUS_MSG, szValue);
SAFE_FREE(&szValue);
if (dat->ppro->m_bXStatusEnabled) {
szValue = GetDlgItemTextUtf(hwndDlg,IDC_XTITLE);
- null_snprintf(szSetting, 64, "XStatus%dName", dat->bXStatus);
+ mir_snprintf(szSetting, 64, "XStatus%dName", dat->bXStatus);
db_set_utf(NULL, dat->ppro->m_szModuleName, szSetting, szValue);
db_set_utf(NULL, dat->ppro->m_szModuleName, DBSETTING_XSTATUS_NAME, szValue);
SAFE_FREE(&szValue);
@@ -794,13 +794,13 @@ void CIcqProto::setXStatusEx(BYTE bXStatus, BYTE bQuiet) char *szName = NULL, *szMsg = NULL;
if (m_bXStatusEnabled) {
- null_snprintf(szSetting, 64, "XStatus%dName", bXStatus);
+ mir_snprintf(szSetting, 64, "XStatus%dName", bXStatus);
szName = getSettingStringUtf(NULL, szSetting, ICQTranslateUtfStatic(nameXStatus[bXStatus-1], str, MAX_PATH));
}
- null_snprintf(szSetting, 64, "XStatus%dMsg", bXStatus);
+ mir_snprintf(szSetting, 64, "XStatus%dMsg", bXStatus);
szMsg = getSettingStringUtf(NULL, szSetting, "");
- null_snprintf(szSetting, 64, "XStatus%dStat", bXStatus);
+ mir_snprintf(szSetting, 64, "XStatus%dStat", bXStatus);
if (!bQuiet && !getByte(szSetting, 0)) {
InitXStatusData init;
init.ppro = this;
@@ -855,7 +855,7 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus) if (m_bHideXStatusUI || m_bHideXStatusMenu)
return;
- null_snprintf(szItem, sizeof(szItem), Translate("%s Custom Status"), m_szModuleName);
+ mir_snprintf(szItem, sizeof(szItem), Translate("%s Custom Status"), m_szModuleName);
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszPopupName = szItem;
@@ -863,7 +863,7 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus) mi.position = 2000040000;
for (int i = 0; i <= XSTATUS_COUNT; i++) {
- null_snprintf(srvFce, sizeof(srvFce), "%s/menuXStatus%d", m_szModuleName, i);
+ mir_snprintf(srvFce, sizeof(srvFce), "%s/menuXStatus%d", m_szModuleName, i);
mi.position++;
@@ -895,7 +895,7 @@ void InitXStatusIcons() for (int i = 0; i < XSTATUS_COUNT; i++) {
char szTemp[100];
- null_snprintf(szTemp, sizeof(szTemp), "icq_xstatus%d", i);
+ mir_snprintf(szTemp, sizeof(szTemp), "icq_xstatus%d", i);
sid.pszName = szTemp;
sid.pszDescription = (LPSTR)nameXStatus[i];
sid.iDefaultIndex = -(IDI_XSTATUS1+i);
diff --git a/protocols/IcqOscarJ/src/icq_xtraz.cpp b/protocols/IcqOscarJ/src/icq_xtraz.cpp index 6a746c2e57..7b3115213d 100644 --- a/protocols/IcqOscarJ/src/icq_xtraz.cpp +++ b/protocols/IcqOscarJ/src/icq_xtraz.cpp @@ -94,7 +94,7 @@ void CIcqProto::handleXtrazNotify(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD w int nResponseLen = 212 + strlennull(szXName) + strlennull(szXMsg) + UINMAXLEN + 2;
char *szResponse = (char*)_alloca(nResponseLen + 1);
// send response
- null_snprintf(szResponse, nResponseLen,
+ mir_snprintf(szResponse, nResponseLen,
"<ret event=\"OnRemoteNotification\">"
"<srv><id>cAwaySrv</id>"
"<val srv_id=\"cAwaySrv\"><Root>"
@@ -415,7 +415,7 @@ DWORD CIcqProto::SendXtrazNotifyRequest(HANDLE hContact, char* szQuery, char* sz szNotifyBody = MangleXml(szNotify, strlennull(szNotify));
nBodyLen = strlennull(szQueryBody) + strlennull(szNotifyBody) + 41;
szBody = (char*)_alloca(nBodyLen);
- nBodyLen = null_snprintf(szBody, nBodyLen, "<N><QUERY>%s</QUERY><NOTIFY>%s</NOTIFY></N>", szQueryBody, szNotifyBody);
+ nBodyLen = mir_snprintf(szBody, nBodyLen, "<N><QUERY>%s</QUERY><NOTIFY>%s</NOTIFY></N>", szQueryBody, szNotifyBody);
SAFE_FREE((void**)&szQueryBody);
SAFE_FREE((void**)&szNotifyBody);
@@ -446,7 +446,7 @@ void CIcqProto::SendXtrazNotifyResponse(DWORD dwUin, DWORD dwMID, DWORD dwMID2, return; // Contact does not support xtraz, do not send anything
}
- nBodyLen = null_snprintf(szBody, nBodyLen, "<NR><RES>%s</RES></NR>", szResBody);
+ nBodyLen = mir_snprintf(szBody, nBodyLen, "<NR><RES>%s</RES></NR>", szResBody);
SAFE_FREE(&szResBody);
// Was request received thru DC and have we a open DC, send through that
diff --git a/protocols/IcqOscarJ/src/log.cpp b/protocols/IcqOscarJ/src/log.cpp index 38857473a5..1c7aef736f 100644 --- a/protocols/IcqOscarJ/src/log.cpp +++ b/protocols/IcqOscarJ/src/log.cpp @@ -138,7 +138,7 @@ void CIcqProto::icq_LogUsingErrorCode(int level, DWORD dwError, const char *szMs }
}
- null_snprintf(szBuf, sizeof(szBuf), "%s%s%s (%s %d)",
+ mir_snprintf(szBuf, sizeof(szBuf), "%s%s%s (%s %d)",
szMsg ? ICQTranslateUtfStatic(szMsg, str, 1024) : "",
szMsg ? "\r\n\r\n" : "",
ICQTranslateUtfStatic(pszErrorMsg, szErrorMsg, 512),
@@ -156,6 +156,6 @@ void CIcqProto::icq_LogFatalParam(const char *szMsg, WORD wError) char str[MAX_PATH];
char buf[MAX_PATH];
- null_snprintf(buf, MAX_PATH, ICQTranslateUtfStatic(szMsg, str, MAX_PATH), wError);
+ mir_snprintf(buf, MAX_PATH, ICQTranslateUtfStatic(szMsg, str, MAX_PATH), wError);
icq_LogMessage(LOG_FATAL, buf);
}
diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp index 15b85bb475..69e7dfc4c8 100644 --- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp +++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp @@ -544,7 +544,7 @@ void CIcqProto::handleRecvServMsgOFT(BYTE *buf, WORD wLen, DWORD dwUin, char *sz pszFileName = (char*)_alloca(64);
char tmp[64];
- null_snprintf(pszFileName, 64, ICQTranslateUtfStatic(LPGEN("%d Files"), tmp, SIZEOF(tmp)), ft->wFilesCount);
+ mir_snprintf(pszFileName, 64, ICQTranslateUtfStatic(LPGEN("%d Files"), tmp, SIZEOF(tmp)), ft->wFilesCount);
}
}
// Total Size TLV (ICQ 6 and AIM 6)
@@ -1835,7 +1835,7 @@ int CIcqProto::oft_handleFileData(oscar_connection *oc, BYTE *buf, int len) char *pszMsg = ICQTranslateUtf(LPGEN("The checksum of file \"%s\" does not match, the file is probably damaged."));
char szBuf[MAX_PATH];
- null_snprintf(szBuf, MAX_PATH, pszMsg, ExtractFileName(ft->szThisFile));
+ mir_snprintf(szBuf, MAX_PATH, pszMsg, ExtractFileName(ft->szThisFile));
icq_LogMessage(LOG_ERROR, szBuf);
SAFE_FREE(&pszMsg);
diff --git a/protocols/IcqOscarJ/src/stdpackets.cpp b/protocols/IcqOscarJ/src/stdpackets.cpp index 69d9fd2ac1..35bae4ca14 100644 --- a/protocols/IcqOscarJ/src/stdpackets.cpp +++ b/protocols/IcqOscarJ/src/stdpackets.cpp @@ -1510,7 +1510,7 @@ DWORD CIcqProto::icq_sendSMSServ(const char *szPhoneNumber, const char *szMsg) if (szBuffer = (char *)_alloca(nBufferSize))
{
- wBufferLen = null_snprintf(szBuffer, nBufferSize,
+ wBufferLen = mir_snprintf(szBuffer, nBufferSize,
"<icq_sms_message>"
"<destination>"
"%s" /* phone number */
@@ -1874,8 +1874,9 @@ void CIcqProto::oft_sendFileRequest(DWORD dwUin, char *szUid, oscar_filetransfer {
icq_packet packet;
- char *szCoolStr = (char*)_alloca(strlennull(ft->szDescription)+strlennull(pszFiles) + 160);
- sprintf(szCoolStr, "<ICQ_COOL_FT><FS>%s</FS><S>%I64u</S><SID>1</SID><DESC>%s</DESC></ICQ_COOL_FT>", pszFiles, ft->qwTotalSize, ft->szDescription);
+ size_t size = strlennull(ft->szDescription)+strlennull(pszFiles) + 160;
+ char *szCoolStr = (char *)_alloca(size);
+ mir_snprintf(szCoolStr, size, "<ICQ_COOL_FT><FS>%s</FS><S>%I64u</S><SID>1</SID><DESC>%s</DESC></ICQ_COOL_FT>", pszFiles, ft->qwTotalSize, ft->szDescription);
szCoolStr = MangleXml(szCoolStr, strlennull(szCoolStr));
WORD wDataLen = 93 + strlennull(szCoolStr) + strlennull(pszFiles);
diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp index 9d8aa40321..a3fb13398c 100644 --- a/protocols/IcqOscarJ/src/utilities.cpp +++ b/protocols/IcqOscarJ/src/utilities.cpp @@ -688,31 +688,6 @@ char* __fastcall strstrnull(const char *str, const char *substr) return NULL;
}
-int null_snprintf(char *buffer, size_t count, const char *fmt, ...)
-{
- va_list va;
- int len;
-
- ZeroMemory(buffer, count);
- va_start(va, fmt);
- len = _vsnprintf(buffer, count-1, fmt, va);
- va_end(va);
- return len;
-}
-
-int null_snprintf(WCHAR *buffer, size_t count, const WCHAR *fmt, ...)
-{
- va_list va;
- int len;
-
- ZeroMemory(buffer, count * sizeof(WCHAR));
- va_start(va, fmt);
- len = _vsnwprintf(buffer, count, fmt, va);
- va_end(va);
- return len;
-}
-
-
char* __fastcall null_strdup(const char *string)
{
if (string)
diff --git a/protocols/IcqOscarJ/src/utilities.h b/protocols/IcqOscarJ/src/utilities.h index fe01ea8c34..de1274081b 100644 --- a/protocols/IcqOscarJ/src/utilities.h +++ b/protocols/IcqOscarJ/src/utilities.h @@ -75,13 +75,11 @@ int __fastcall strlennull(const char *string); int __fastcall strcmpnull(const char *str1, const char *str2);
int __fastcall stricmpnull(const char *str1, const char *str2);
char* __fastcall strstrnull(const char *str, const char *substr);
-int null_snprintf(char *buffer, size_t count, const char *fmt, ...);
char* __fastcall null_strdup(const char *string);
char* __fastcall null_strcpy(char *dest, const char *src, size_t maxlen);
int __fastcall null_strcut(char *string, int maxlen);
int __fastcall strlennull(const WCHAR *string);
-int null_snprintf(WCHAR *buffer, size_t count, const WCHAR *fmt, ...);
WCHAR* __fastcall null_strdup(const WCHAR *string);
WCHAR* __fastcall null_strcpy(WCHAR *dest, const WCHAR *src, size_t maxlen);
|