diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-07-22 17:54:52 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-07-22 17:54:52 +0000 |
commit | 44775ea68f894c3e236cdc397d6b0856c5882143 (patch) | |
tree | 32088426164d4aec937c4ce82f0725e600c4ba66 | |
parent | 01de930753fd7a5d47c0350a4361949d770b93cf (diff) |
replace sprintf to mir_snprintf (part 2)
git-svn-id: http://svn.miranda-ng.org/main/trunk@5447 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/ClientChangeNotify/src/CommonLibs/CString.cpp | 14 | ||||
-rw-r--r-- | plugins/MenuItemEx/src/main.cpp | 18 | ||||
-rwxr-xr-x | plugins/MetaContacts/src/meta_services.cpp | 2 | ||||
-rw-r--r-- | plugins/NotesAndReminders/src/notes.cpp | 22 | ||||
-rw-r--r-- | plugins/NotesAndReminders/src/reminders.cpp | 100 | ||||
-rw-r--r-- | plugins/SecureIM/src/options.cpp | 16 | ||||
-rw-r--r-- | plugins/SecureIM/src/svcs_rsa.cpp | 6 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/clist.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/log.cpp | 4 |
9 files changed, 54 insertions, 130 deletions
diff --git a/plugins/ClientChangeNotify/src/CommonLibs/CString.cpp b/plugins/ClientChangeNotify/src/CommonLibs/CString.cpp index b36076eec8..a874b75721 100644 --- a/plugins/ClientChangeNotify/src/CommonLibs/CString.cpp +++ b/plugins/ClientChangeNotify/src/CommonLibs/CString.cpp @@ -268,24 +268,10 @@ TString<T>& TString<T>::operator = (const T *pStr) return *this;
}
-
-/*TCString& TCString::Format(char *pszFormat, ...)
-{
- va_list argList;
- va_start(argList, pszFormat);
- int StrLen = _vscprintf(pszFormat, argList); // it's stupidity. in some versions of msvcrt.dll there's no _vscprintf function, so there's no any way to determine needed string length. so actually I can't use _vsnprintf too.
- _vsnprintf(GetBuffer(StrLen), StrLen, pszFormat, argList);
- ReleaseBuffer(StrLen);
- va_end(argList);
- return *this;
-}
-*/
-
template class TString<TCHAR>;
template class TString<char>;
template class TString<WCHAR>;
-
CString db_get_s(HANDLE hContact, const char *szModule, const char *szSetting, const char *szDefaultValue)
{
ptrA p( db_get_sa(hContact, szModule, szSetting));
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index 30168a3466..37e33d37d2 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -297,13 +297,13 @@ void GetID(HANDLE hContact,LPSTR szProto,LPSTR szID) if ( uID && db_get(hContact, szProto, uID ,&dbv_uniqueid) == 0 ) {
if (dbv_uniqueid.type == DBVT_DWORD)
- wsprintfA(szID, "%u", dbv_uniqueid.dVal);
+ wsprintfA(szID, "%u", dbv_uniqueid.dVal); //!!!!!!!!!
else if (dbv_uniqueid.type == DBVT_WORD)
- wsprintfA(szID, "%u", dbv_uniqueid.wVal);
+ wsprintfA(szID, "%u", dbv_uniqueid.wVal); //!!!!!!!!!
else if (dbv_uniqueid.type == DBVT_BLOB)
- wsprintfA(szID, "%s", dbv_uniqueid.cpbVal);
+ wsprintfA(szID, "%s", dbv_uniqueid.cpbVal); //!!!!!!!!!
else
- wsprintfA(szID, "%s", dbv_uniqueid.pszVal);
+ wsprintfA(szID, "%s", dbv_uniqueid.pszVal); //!!!!!!!!
db_free(&dbv_uniqueid);
}
@@ -370,10 +370,12 @@ void getIP(HANDLE hContact,LPSTR szProto,LPSTR szIP) char szrIP[64] = {0};
DWORD mIP = db_get_dw(hContact, szProto, "IP", 0);
DWORD rIP = db_get_dw(hContact, szProto, "RealIP", 0);
- if ( mIP ) wsprintfA(szmIP, "External IP: %d.%d.%d.%d\r\n", mIP>>24,(mIP>>16)&0xFF,(mIP>>8)&0xFF,mIP&0xFF);
- if ( rIP ) wsprintfA(szrIP, "Internal IP: %d.%d.%d.%d\r\n", rIP>>24,(rIP>>16)&0xFF,(rIP>>8)&0xFF,rIP&0xFF);
- strcpy(szIP,szrIP);
- strcat(szIP,szmIP);
+ if (mIP)
+ mir_snprintf(szmIP, SIZEOF(szmIP), "External IP: %d.%d.%d.%d\r\n", mIP>>24, (mIP>>16)&0xFF, (mIP>>8)&0xFF, mIP&0xFF);
+ if (rIP)
+ mir_snprintf(szrIP, SIZEOF(szrIP), "Internal IP: %d.%d.%d.%d\r\n", rIP>>24, (rIP>>16)&0xFF, (rIP>>8)&0xFF, rIP&0xFF);
+ strcpy(szIP, szrIP);
+ strcat(szIP, szmIP);
}
LPSTR getMirVer(HANDLE hContact)
diff --git a/plugins/MetaContacts/src/meta_services.cpp b/plugins/MetaContacts/src/meta_services.cpp index 79f40b5ca2..55562a2f84 100755 --- a/plugins/MetaContacts/src/meta_services.cpp +++ b/plugins/MetaContacts/src/meta_services.cpp @@ -1087,7 +1087,7 @@ int Meta_ModulesLoaded(WPARAM wParam, LPARAM lParam) for (int i = 0; i < numberOfProtocols ; i++)
if ( strcmp(ppProtocolDescriptors[i]->szModuleName, META_PROTO)) {
char str[MAXMODULELABELLENGTH + 10];
- sprintf(str,"%s/Nudge",ppProtocolDescriptors[i]->szModuleName);
+ mir_snprintf(str, SIZEOF(str), "%s/Nudge", ppProtocolDescriptors[i]->szModuleName);
HookEvent(str, NudgeRecieved);
}
diff --git a/plugins/NotesAndReminders/src/notes.cpp b/plugins/NotesAndReminders/src/notes.cpp index 9eaca318a1..9907655063 100644 --- a/plugins/NotesAndReminders/src/notes.cpp +++ b/plugins/NotesAndReminders/src/notes.cpp @@ -381,7 +381,7 @@ void LoadNotes(BOOL bIsStartup) {
char *DelPos;
- sprintf(ValueName, "NotesData%d", I);
+ mir_snprintf(ValueName, SIZEOF(ValueName), "NotesData%d", I);
if (Value)
{
@@ -694,7 +694,7 @@ void PurgeNotes(void) NotesCount = db_get_dw(0,MODULENAME,"NotesData",0);
for(I = 0; I < NotesCount; I++)
{
- sprintf(ValueName, "NotesData%d", I);
+ mir_snprintf(ValueName, SIZEOF(ValueName), "NotesData%d", I);
db_unset(0,MODULENAME,ValueName);
}
}
@@ -886,27 +886,27 @@ static void JustSaveNotesEx(STICKYNOTE *pModified) n = 0;
// data header
- l = sprintf(Value, "X%I64x:%d:%d:%d:%d:%x", pNote->ID.QuadPart, TX, TY, TW, TH, flags);
+ l = sprintf(Value, "X%I64x:%d:%d:%d:%d:%x", pNote->ID.QuadPart, TX, TY, TW, TH, flags); //!!!!!!!!!!!!
if (l > 0) n += l;
// scroll pos
if (scrollV > 0)
{
- l = sprintf(Value+n, "\033""%u:%u", DATATAG_SCROLLPOS, (UINT)scrollV);
+ l = sprintf(Value+n, "\033""%u:%u", DATATAG_SCROLLPOS, (UINT)scrollV); //!!!!!!!!!!
if (l > 0) n += l;
}
// custom bg color
if (pNote->BgColor)
{
- l = sprintf(Value+n, "\033""%u:%x", DATATAG_BGCOL, (UINT)(pNote->BgColor&0xffffff));
+ l = sprintf(Value+n, "\033""%u:%x", DATATAG_BGCOL, (UINT)(pNote->BgColor&0xffffff)); //!!!!!!!!!!!!!
if (l > 0) n += l;
}
// custom fg color
if (pNote->FgColor)
{
- l = sprintf(Value+n, "\033""%u:%x", DATATAG_FGCOL, (UINT)(pNote->FgColor&0xffffff));
+ l = sprintf(Value+n, "\033""%u:%x", DATATAG_FGCOL, (UINT)(pNote->FgColor&0xffffff)); //!!!!!!!!!!!!!
if (l > 0) n += l;
}
@@ -914,21 +914,21 @@ static void JustSaveNotesEx(STICKYNOTE *pModified) {
l = sprintf(Value+n, "\033""%u:%d:%u:%u:%s", DATATAG_FONT,
(int)pNote->pCustomFont->size, (UINT)pNote->pCustomFont->style, (UINT)pNote->pCustomFont->charset,
- pNote->pCustomFont->szFace);
+ pNote->pCustomFont->szFace); //!!!!!!!!!!!!!!!
if (l > 0) n += l;
}
// custom title
if (pNote->CustomTitle && pNote->title)
{
- l = sprintf(Value+n, "\033""%u:%s", DATATAG_TITLE, pNote->title);
+ l = sprintf(Value+n, "\033""%u:%s", DATATAG_TITLE, pNote->title); //!!!!!!!!!!!!!
if (l > 0) n += l;
}
// note text (ALWAYS PUT THIS PARAM LAST)
if (tData)
{
- l = sprintf(Value+n, "\033""%u:%s", DATATAG_TEXT, tData);
+ l = sprintf(Value+n, "\033""%u:%s", DATATAG_TEXT, tData); //!!!!!!!!!!!!
if (l > 0) n += l;
}
@@ -940,7 +940,7 @@ static void JustSaveNotesEx(STICKYNOTE *pModified) Value[0xffff] = 0;
}
- sprintf(ValueName, "NotesData%d", NotesCount - I - 1); // we do not reverse notes in DB
+ mir_snprintf(ValueName, SIZEOF(ValueName), "NotesData%d", NotesCount - I - 1); // we do not reverse notes in DB
db_set_blob(0, MODULENAME, ValueName, Value, n+1);
@@ -956,7 +956,7 @@ static void JustSaveNotesEx(STICKYNOTE *pModified) // delete any left over DB note entries
for(; I < OldNotesCount; I++)
{
- sprintf(ValueName, "NotesData%d", I);
+ mir_snprintf(ValueName, SIZEOF(ValueName), "NotesData%d", I);
db_unset(0,MODULENAME,ValueName);
}
diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp index f23bcbfdc4..c2fc4306ea 100644 --- a/plugins/NotesAndReminders/src/reminders.cpp +++ b/plugins/NotesAndReminders/src/reminders.cpp @@ -376,7 +376,7 @@ void PurgeReminders(void) ReminderCount = db_get_dw(0,MODULENAME,"RemindersData",0);
for(I = 0;I < ReminderCount;I++)
{
- sprintf(ValueName, "RemindersData%d", I);
+ mir_snprintf(ValueName, SIZEOF(ValueName), "RemindersData%d", I);
db_unset(0, MODULENAME, ValueName);
}
}
@@ -416,27 +416,27 @@ void JustSaveReminders(void) // data header (save 'When' with 1-second resolution, it's just a waste to have 100-nanosecond resolution
// which results in larger DB strings with no use)
- l = sprintf(Value, "X%u:%I64x", pReminder->uid, pReminder->When.QuadPart/FILETIME_TICKS_PER_SEC);
+ l = sprintf(Value, "X%u:%I64x", pReminder->uid, pReminder->When.QuadPart/FILETIME_TICKS_PER_SEC); //!!!!!!!!!
if (l > 0) n += l;
// sound repeat
if (pReminder->RepeatSound)
{
- l = sprintf(Value+n, "\033""%u:%u", DATATAG_SNDREPEAT, pReminder->RepeatSound);
+ l = sprintf(Value+n, "\033""%u:%u", DATATAG_SNDREPEAT, pReminder->RepeatSound); //!!!!!!!!!!
if (l > 0) n += l;
}
// sound
if (pReminder->SoundSel)
{
- l = sprintf(Value+n, "\033""%u:%d", DATATAG_SNDSEL, pReminder->SoundSel);
+ l = sprintf(Value+n, "\033""%u:%d", DATATAG_SNDSEL, pReminder->SoundSel); //!!!!!!!!!
if (l > 0) n += l;
}
// reminder text/note (ALWAYS PUT THIS PARAM LAST)
if (tmpReminder && *tmpReminder)
{
- l = sprintf(Value+n, "\033""%u:%s", DATATAG_TEXT, tmpReminder);
+ l = sprintf(Value+n, "\033""%u:%s", DATATAG_TEXT, tmpReminder); //!!!!!!!!!!!
if (l > 0) n += l;
}
@@ -448,7 +448,7 @@ void JustSaveReminders(void) Value[0xffff] = 0;
}
- sprintf(ValueName, "RemindersData%d", ReminderCount - I - 1); // do not want to reverse in DB
+ mir_snprintf(ValueName, SIZEOF(ValueName), "RemindersData%d", ReminderCount - I - 1); // do not want to reverse in DB
db_set_blob(0, MODULENAME, ValueName, Value, n+1);
@@ -458,8 +458,8 @@ void JustSaveReminders(void) // delete any left over DB reminder entries
for(; I < OldReminderCount; I++)
{
- sprintf(ValueName, "RemindersData%d", I);
- db_unset(0,MODULENAME,ValueName);
+ mir_snprintf(ValueName, SIZEOF(ValueName), "RemindersData%d", I);
+ db_unset(0, MODULENAME, ValueName);
}
}
@@ -478,7 +478,7 @@ void LoadReminders(void) {
Size = 65535;
Value = NULL;
- sprintf(ValueName, "RemindersData%d", I);
+ mir_snprintf(ValueName, SIZEOF(ValueName), "RemindersData%d", I);
ReadSettingBlob(0, MODULENAME, ValueName, &Size, (void**)&Value);
@@ -623,70 +623,6 @@ skip:; }
}
-
-/*void EscapeString(LPCSTR lpszSrc, char *s, int maxLen)
-{
- maxLen -= 3;
-
- *s++ = '"';
-
- while (*lpszSrc && maxLen > 1)
- {
- switch (*lpszSrc)
- {
- case '\r': *s++ = '\\'; *s++ = 'r'; break;
- case '\n': *s++ = '\\'; *s++ = 'n'; break;
- case '"': *s++ = '\\'; *s++ = '"'; break;
- case '\t': *s++ = '\\'; *s++ = 't'; break;
- case '\\': *s++ = '\\'; *s++ = '\\'; break;
- default:
- *s++ = *lpszSrc;
- }
-
- lpszSrc++;
- maxLen--;
- }
-
- *s++ = '"';
- *s = 0;
-}
-
-void ExportReminders()
-{
- LPCSTR lpsz;
- TREEELEMENT *TTE;
- char s[MAX_REMINDER_LEN+512];
-
- if (!RemindersList)
- return NULL;
-
- // CSV header
- lpsz = "TimeUTC,SoundSel,SoundRepeat,Description";
- WriteFile(hFile, lpsz, strlen(lpsz), NULL, NULL);
-
- TTE = RemindersList;
- while (TTE)
- {
- REMINDERDATA *pReminder = (REMINDERDATA*)TTE->ptrdata;
-
- sprintf(s, "%I64u,%d,%d,", (pReminder->When.QuadPart-(ULONGLONG)116444736000000000)/FILETIME_TICKS_PER_SEC, pReminder->SoundSel, pReminder->RepeatSound);
- WriteFile(hFile, s, strlen(s), NULL, NULL);
-
- if (pReminder->Reminder)
- {
- EscapeString(pReminder->Reminder, s, sizeof(s));
- WriteFile(hFile, s, strlen(s), NULL, NULL);
- }
-
- WriteFile(hFile, (LPCVOID)"\r\n", 2, NULL, NULL);
-
- TTE = TTE->next;
- }
-
- return NULL;
-}*/
-
-
void NewReminder(void)
{
if (!NewReminderVisible)
@@ -832,7 +768,7 @@ INT_PTR OpenTriggeredReminder(WPARAM w, LPARAM l) pReminder->handle = H = CreateDialog(hinstance, MAKEINTRESOURCE(IDD_NOTIFYREMINDER), 0, DlgProcNotifyReminder);
- sprintf(S, "%s! - %s", Translate("Reminder"), S1);
+ mir_snprintf(S, SIZEOF(S), "%s! - %s", Translate("Reminder"), S1);
SetWindowText(H, S);
if (pReminder->Reminder)
@@ -1280,7 +1216,7 @@ static void PopulateTimeCombo(HWND Dialog, UINT nIDTime, BOOL bRelative, const S const int m = (i&1) ? 30 : 0;
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
- sprintf(s, "%02d:%02d", (UINT)tm2.wHour, (UINT)tm2.wMinute);
+ mir_snprintf(s, SIZEOF(s), "%02d:%02d", (UINT)tm2.wHour, (UINT)tm2.wMinute);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
// item data contains time offset from midnight in seconds (bit 31 is set to flag that
// combo box items are absolute times and not relative times like below
@@ -1507,7 +1443,7 @@ static int ReformatTimeInputEx(HWND Dialog, UINT nIDTime, UINT nIDRefTime, int h //
- sprintf(buf, "%02d:%02d", h, m);
+ mir_snprintf(buf, SIZEOF(buf), "%02d:%02d", h, m);
// search for preset first
n = SendDlgItemMessage(Dialog, nIDTime, CB_FINDSTRING, (WPARAM)-1, (LPARAM)buf);
@@ -1614,7 +1550,7 @@ output_result: if ((int)Date.wHour != h || (int)Date.wMinute != m)
{
- sprintf(buf, "%02d:%02d", (UINT)Date.wHour, (UINT)Date.wMinute);
+ mir_snprintf(buf, SIZEOF(buf), "%02d:%02d", (UINT)Date.wHour, (UINT)Date.wMinute);
// search for preset again
n = SendDlgItemMessage(Dialog, nIDTime, CB_FINDSTRING, (WPARAM)-1, (LPARAM)buf);
@@ -1795,7 +1731,7 @@ INT_PTR CALLBACK DlgProcNotifyReminder(HWND Dialog,UINT Message,WPARAM wParam,LP // which could potentially mess up things otherwise)
{
char s[32];
- sprintf(s, "%I64x", li.QuadPart);
+ mir_snprintf(s, SIZEOF(s), "%I64x", li.QuadPart);
SetDlgItemText(Dialog, IDC_REFTIME, s);
}
@@ -1909,12 +1845,12 @@ INT_PTR CALLBACK DlgProcNotifyReminder(HWND Dialog,UINT Message,WPARAM wParam,LP if (h)
{
LPCSTR lpszHours = Translate("Hours");
- sprintf(buf, "%d:%02d %s", h, m, lpszHours);
+ mir_snprintf(buf, SIZEOF(buf), "%d:%02d %s", h, m, lpszHours);
}
else
{
LPCSTR lpszMinutes = Translate("Minutes");
- sprintf(buf, "%d %s", m, lpszMinutes);
+ mir_snprintf(buf, SIZEOF(buf), "%d %s", m, lpszMinutes);
}
SetDlgItemText(Dialog, IDC_REMINDAGAININ, buf);
}
@@ -2140,7 +2076,7 @@ INT_PTR CALLBACK DlgProcNewReminder(HWND Dialog,UINT Message,WPARAM wParam,LPARA // which could potentially mess up things otherwise)
{
char s[32];
- sprintf(s, "%I64x", li.QuadPart);
+ mir_snprintf(s, SIZEOF(s), "%I64x", li.QuadPart);
SetDlgItemText(Dialog, IDC_REFTIME, s);
}
@@ -2852,7 +2788,7 @@ void Send(char *user, char *host, char *Msg, char *server) sockaddr.sin_family = AF_INET;
if(connect(S,(SOCKADDR*)&sockaddr,sizeof(sockaddr)) == SOCKET_ERROR) return;
ch = (char*)malloc(strlen(user) + strlen(host) + 16);
- ch = (char*)realloc(ch,sprintf(ch,"rcpt to:%s@%s\r\n",user,host));
+ ch = (char*)realloc(ch,sprintf(ch,"rcpt to:%s@%s\r\n",user,host)); //!!!!!!!!!!
WS_Send(S,"mail from: \r\n",13);
WS_Send(S,ch,(int)strlen(ch));
WS_Send(S,"data\r\n",6);
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index 173447a1bb..8c5aa20bbb 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -1047,7 +1047,7 @@ void RefreshPGPDlg(HWND hDlg, BOOL iInit) if (bPGPloaded && ver) {
char pgpVerStr[64];
- sprintf(pgpVerStr, Translate(sim218), ver >> 24, (ver >> 16) & 255, (ver >> 8) & 255);
+ mir_snprintf(pgpVerStr, SIZEOF(pgpVerStr), Translate(sim218), ver >> 24, (ver >> 16) & 255, (ver >> 8) & 255);
SetDlgItemText(hDlg, IDC_PGP_SDK, pgpVerStr);
}
else SetDlgItemText(hDlg, IDC_PGP_SDK, Translate(sim219));
@@ -1303,8 +1303,8 @@ void ApplyProtoSettings(HWND hDlg) pSupPro p = arProto[ getListViewProto(hLV,i) ];
p->inspecting = ListView_GetCheckState(hLV,i);
char tmp[128];
- sprintf(tmp, "%s:%d:%d:%d;", p->name, p->inspecting, p->tsplit_on, p->tsplit_off);
- strcat(szNames,tmp);
+ mir_snprintf(tmp, SIZEOF(tmp), "%s:%d:%d:%d;", p->name, p->inspecting, p->tsplit_on, p->tsplit_off);
+ strcat(szNames, tmp);
p->split_on = p->tsplit_on;
p->split_off = p->tsplit_off;
i = ListView_GetNextItem(hLV,i,LVNI_ALL);
@@ -1542,15 +1542,15 @@ void ListView_Sort(HWND hLV, LPARAM lParamSort) char t[32];
// restore sort column
- sprintf(t,"os%02x",(UINT)lParamSort&0xF0);
- if ((lParamSort&0x0F) == 0)
- lParamSort=(int)db_get_b(0, MODULENAME, t, lParamSort+1);
+ mir_snprintf(t, SIZEOF(t), "os%02x", (UINT)lParamSort & 0xF0);
+ if ((lParamSort & 0x0F) == 0)
+ lParamSort = (int)db_get_b(0, MODULENAME, t, lParamSort + 1);
db_set_b(0, MODULENAME, t, (BYTE)lParamSort);
// restore sort order
- sprintf(t,"os%02x",(UINT)lParamSort);
- int m=db_get_b(0, MODULENAME, t, 0);
+ mir_snprintf(t, SIZEOF(t), "os%02x", (UINT)lParamSort);
+ int m = db_get_b(0, MODULENAME, t, 0);
if (bChangeSortOrder){ m=!m; db_set_b(0, MODULENAME, t, m); }
ListView_SortItems(hLV,&CompareFunc,lParamSort|(m<<8));
diff --git a/plugins/SecureIM/src/svcs_rsa.cpp b/plugins/SecureIM/src/svcs_rsa.cpp index 1ef0ecbbb0..22035d17bc 100644 --- a/plugins/SecureIM/src/svcs_rsa.cpp +++ b/plugins/SecureIM/src/svcs_rsa.cpp @@ -118,11 +118,11 @@ void __cdecl rsa_notify(HANDLE context, int state) case -0x60:
{
char buf[1024];
- sprintf(buf,sim510,-state);
- showPopupDCmsg(ptr->hContact,buf);
+ mir_snprintf(buf, SIZEOF(buf), sim510, -state);
+ showPopupDCmsg(ptr->hContact, buf);
ShowStatusIconNotify(ptr->hContact);
if (ptr->cntx) deleteRSAcntx(ptr);
- waitForExchange(ptr,3); // досылаем нешифровано
+ waitForExchange(ptr, 3); // досылаем нешифровано
}
return;
diff --git a/plugins/TabSRMM/src/chat/clist.cpp b/plugins/TabSRMM/src/chat/clist.cpp index 363e815947..b570c360f1 100644 --- a/plugins/TabSRMM/src/chat/clist.cpp +++ b/plugins/TabSRMM/src/chat/clist.cpp @@ -267,7 +267,7 @@ BOOL CList_AddEvent(HANDLE hContact, HICON Icon, HANDLE event, int type, const T return FALSE;
va_start(marker, fmt);
- mir_vsntprintf(szBuf, _tcslen(szBuf), fmt, marker);
+ _vstprintf(szBuf, fmt, marker); //!!!!!!!!
va_end(marker);
cle.cbSize = sizeof(cle);
diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp index 6b02b68d5d..0d45441233 100644 --- a/plugins/TabSRMM/src/chat/log.cpp +++ b/plugins/TabSRMM/src/chat/log.cpp @@ -621,7 +621,7 @@ static int Log_AppendRTF(LOGSTREAMDATA* streamData, BOOL simpleMode, char **buff } else if (*line > 0 && *line < 128) {
*d++ = (char) * line;
}
- else d += mir_snprintf(d, strlen(d), "\\u%u ?", (WORD) * line);
+ else d += sprintf(d, "\\u%u ?", (WORD) * line); //!!!!!!!!!
}
*cbBufferEnd = (int)(d - *buffer);
@@ -1284,7 +1284,7 @@ void LoadMsgLogBitmaps(void) for (i=0; i < SIZEOF(pLogIconBmpBits); i++) {
hIcon = hIcons[i];
pLogIconBmpBits[i] = (PBYTE) mir_alloc(RTFPICTHEADERMAXSIZE + (bih.biSize + widthBytes * bih.biHeight) * 2);
- rtfHeaderSize = mir_snprintf((char *)pLogIconBmpBits[i], strlen((char *)pLogIconBmpBits[i]), "{\\pict\\dibitmap0\\wbmbitspixel%u\\wbmplanes1\\wbmwidthbytes%u\\picw%u\\pich%u ", bih.biBitCount, widthBytes, bih.biWidth, bih.biHeight);
+ rtfHeaderSize = sprintf((char *)pLogIconBmpBits[i], "{\\pict\\dibitmap0\\wbmbitspixel%u\\wbmplanes1\\wbmwidthbytes%u\\picw%u\\pich%u ", bih.biBitCount, widthBytes, bih.biWidth, bih.biHeight); //!!!!!!!!!!
hoBmp = (HBITMAP) SelectObject(hdcMem, hBmp);
FillRect(hdcMem, &rc, hBkgBrush);
DrawIconEx(hdcMem, 0, 1, hIcon, iIconSize, iIconSize, 0, NULL, DI_NORMAL);
|