diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-07-24 14:52:01 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-07-24 14:52:01 +0000 |
commit | 3e02ce14f6cce63910b266655a9c33bd3a70f17a (patch) | |
tree | 8fcf4371ea0d10693e7697f305d51988484faf69 /plugins/Scriver | |
parent | 107471fac771abe5774d10769e36c0903a908685 (diff) |
replace sprintf to mir_snprintf (part 4)
git-svn-id: http://svn.miranda-ng.org/main/trunk@5467 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Scriver')
-rw-r--r-- | plugins/Scriver/src/chat/log.cpp | 12 | ||||
-rw-r--r-- | plugins/Scriver/src/chat/manager.cpp | 2 | ||||
-rw-r--r-- | plugins/Scriver/src/msglog.cpp | 12 |
3 files changed, 13 insertions, 13 deletions
diff --git a/plugins/Scriver/src/chat/log.cpp b/plugins/Scriver/src/chat/log.cpp index a06be991bb..2865e43164 100644 --- a/plugins/Scriver/src/chat/log.cpp +++ b/plugins/Scriver/src/chat/log.cpp @@ -100,7 +100,7 @@ static int Log_AppendRTF(LOGSTREAMDATA* streamData, BOOL simpleMode, char **buff char* d;
va_start(va, fmt);
- lineLen = _vsntprintf( line, 8000, fmt, va);
+ lineLen = mir_vsntprintf(line, 8000, fmt, va);
if (lineLen < 0) lineLen = 8000;
line[lineLen] = 0;
va_end(va);
@@ -203,7 +203,7 @@ static int Log_AppendRTF(LOGSTREAMDATA* streamData, BOOL simpleMode, char **buff else if (*line > 0 && *line < 128) {
*d++ = (char) *line;
} else {
- d += sprintf(d, "\\u%u ?", (WORD)*line);
+ d += sprintf(d, "\\u%u ?", (WORD)*line); //!!!!!!!!!
}
}
@@ -220,7 +220,7 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR ** MODULEINFO *mi = MM_FindModule(streamData->si->pszModule);
va_start(va, fmt);
- lineLen = _vsntprintf( line, 8000, fmt, va);
+ lineLen = mir_vsntprintf(line, 8000, fmt, va);
if (lineLen < 0)
return 0;
line[lineLen] = 0;
@@ -929,7 +929,7 @@ void LoadMsgLogBitmaps(void) for (int i = 0; i < SIZEOF(pLogIconBmpBits); i++) {
HICON hIcon = GetCachedIcon(logIconNames[i]);
pLogIconBmpBits[i] = (PBYTE) mir_alloc(RTFPICTHEADERMAXSIZE + (bih.biSize + widthBytes * bih.biHeight) * 2);
- int rtfHeaderSize = sprintf((char*)pLogIconBmpBits[i], "{\\pict\\dibitmap0\\wbmbitspixel%u\\wbmplanes1\\wbmwidthbytes%u\\picw%u\\pich%u ", bih.biBitCount, widthBytes, (unsigned int)bih.biWidth, (unsigned int)bih.biHeight);
+ int rtfHeaderSize = sprintf((char*)pLogIconBmpBits[i], "{\\pict\\dibitmap0\\wbmbitspixel%u\\wbmplanes1\\wbmwidthbytes%u\\picw%u\\pich%u ", bih.biBitCount, widthBytes, (unsigned int)bih.biWidth, (unsigned int)bih.biHeight); //!!!!!!!!!!
HBITMAP hoBmp = (HBITMAP) SelectObject(hdcMem, hBmp);
FillRect(hdcMem, &rc, hBkgBrush);
DrawIconEx(hdcMem, 0, 0, hIcon, bih.biWidth, bih.biHeight, 0, NULL, DI_NORMAL);
@@ -938,9 +938,9 @@ void LoadMsgLogBitmaps(void) int n;
for (n = 0; n < sizeof(BITMAPINFOHEADER); n++)
- sprintf((char*)pLogIconBmpBits[i] + rtfHeaderSize + n * 2, "%02X", ((PBYTE) & bih)[n]);
+ sprintf((char*)pLogIconBmpBits[i] + rtfHeaderSize + n * 2, "%02X", ((PBYTE) & bih)[n]); //!!!!!!!!!!!!!!
for (n = 0; n < widthBytes * bih.biHeight; n += 4)
- sprintf((char*)pLogIconBmpBits[i] + rtfHeaderSize + (bih.biSize + n) * 2, "%02X%02X%02X%02X", pBmpBits[n], pBmpBits[n + 1], pBmpBits[n + 2], pBmpBits[n + 3]);
+ sprintf((char*)pLogIconBmpBits[i] + rtfHeaderSize + (bih.biSize + n) * 2, "%02X%02X%02X%02X", pBmpBits[n], pBmpBits[n + 1], pBmpBits[n + 2], pBmpBits[n + 3]); //!!!!!!!!!!!!!!!
logIconBmpSize[i] = rtfHeaderSize + (bih.biSize + widthBytes * bih.biHeight) * 2 + 1;
pLogIconBmpBits[i][logIconBmpSize[i] - 1] = '}';
diff --git a/plugins/Scriver/src/chat/manager.cpp b/plugins/Scriver/src/chat/manager.cpp index 0c1a994cf1..009b9c266b 100644 --- a/plugins/Scriver/src/chat/manager.cpp +++ b/plugins/Scriver/src/chat/manager.cpp @@ -272,7 +272,7 @@ HICON SM_GetStatusIcon(SESSION_INFO *si, USERINFO * ui) {
INT_PTR id = si->iStatusCount - (INT_PTR)ti->hIcon - 1;
char name[128];
- sprintf(name, "chat_status%d", id);
+ mir_snprintf(name, SIZEOF(name), "chat_status%d", id);
return GetCachedIcon(name);
}
else
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index e6b86353a0..d3b1a92aa9 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -303,10 +303,10 @@ static int AppendUnicodeOrAnsiiToBufferL(char **buffer, int *cbBufferEnd, int *c *d++ = (char) *line;
}
else if (isAnsii) {
- d += sprintf(d, "\\'%02x", (*line) & 0xFF);
+ d += sprintf(d, "\\'%02x", (*line) & 0xFF); //!!!!!!!!!!
}
else {
- d += sprintf(d, "\\u%d ?", *line);
+ d += sprintf(d, "\\u%d ?", *line); //!!!!!!!!!!
}
}
if (wasEOL) {
@@ -415,7 +415,7 @@ static char *SetToStyle(int style) LOGFONT lf;
LoadMsgDlgFont(style, &lf, NULL, FALSE);
- wsprintfA(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, SIZEOF(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;
}
@@ -1005,7 +1005,7 @@ void LoadMsgLogIcons(void) }
pLogIconBmpBits[i] = (PBYTE) mir_alloc(RTFPICTHEADERMAXSIZE + (bih.biSize + widthBytes * bih.biHeight) * 2);
//I can't seem to get binary mode working. No matter.
- int rtfHeaderSize = sprintf((char*)pLogIconBmpBits[i], "{\\pict\\dibitmap0\\wbmbitspixel%u\\wbmplanes1\\wbmwidthbytes%u\\picw%u\\pich%u ", bih.biBitCount, widthBytes, (UINT) bih.biWidth, (UINT)bih.biHeight);
+ int rtfHeaderSize = sprintf((char*)pLogIconBmpBits[i], "{\\pict\\dibitmap0\\wbmbitspixel%u\\wbmplanes1\\wbmwidthbytes%u\\picw%u\\pich%u ", bih.biBitCount, widthBytes, (UINT) bih.biWidth, (UINT)bih.biHeight); //!!!!!!!!!!!
HBITMAP hoBmp = (HBITMAP) SelectObject(hdcMem, hBmp);
FillRect(hdcMem, &rc, hBrush);
DrawIconEx(hdcMem, 0, 0, hIcon, bih.biWidth, bih.biHeight, 0, NULL, DI_NORMAL);
@@ -1015,9 +1015,9 @@ void LoadMsgLogIcons(void) int n;
for (n = 0; n < sizeof(BITMAPINFOHEADER); n++)
- sprintf((char*)pLogIconBmpBits[i] + rtfHeaderSize + n * 2, "%02X", ((PBYTE) & bih)[n]);
+ sprintf((char*)pLogIconBmpBits[i] + rtfHeaderSize + n * 2, "%02X", ((PBYTE) & bih)[n]); //!!!!!!!!!!!!!!
for (n = 0; n < widthBytes * bih.biHeight; n += 4)
- sprintf((char*)pLogIconBmpBits[i] + rtfHeaderSize + (bih.biSize + n) * 2, "%02X%02X%02X%02X", pBmpBits[n], pBmpBits[n + 1], pBmpBits[n + 2], pBmpBits[n + 3]);
+ sprintf((char*)pLogIconBmpBits[i] + rtfHeaderSize + (bih.biSize + n) * 2, "%02X%02X%02X%02X", pBmpBits[n], pBmpBits[n + 1], pBmpBits[n + 2], pBmpBits[n + 3]); //!!!!!!!!!!!!!!!!
logIconBmpSize[i] = rtfHeaderSize + (bih.biSize + widthBytes * bih.biHeight) * 2 + 1;
pLogIconBmpBits[i][logIconBmpSize[i] - 1] = '}';
|