diff options
Diffstat (limited to 'src/core/stdmsg/src/msglog.cpp')
-rw-r--r-- | src/core/stdmsg/src/msglog.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index f2c82f8a9f..53f1ef7582 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -143,7 +143,7 @@ static int AppendToBufferWithRTF(char **buffer, int *cbBufferEnd, int *cbBufferA {
*tag = 0;
*tage = 0;
- d += sprintf(d, "{\\field{\\*\\fldinst HYPERLINK \"%s\"}{\\fldrslt %s}}", mir_t2a(tagu), mir_t2a(tag + 1));
+ d += sprintf(d, "{\\field{\\*\\fldinst HYPERLINK \"%s\"}{\\fldrslt %s}}", mir_t2a(tagu), mir_t2a(tag + 1)); //!!!!!!!!!!
line = tage + 5;
found = 1;
}
@@ -167,11 +167,11 @@ static int AppendToBufferWithRTF(char **buffer, int *cbBufferEnd, int *cbBufferA if (!found)
{
if (*line < 128) *d++ = (char) *line;
- else d += sprintf(d, "\\u%d ?", *line);
+ else d += sprintf(d, "\\u%d ?", *line); //!!!!!!!!!!
}
}
else if (*line < 128) *d++ = (char) *line;
- else d += sprintf(d, "\\u%d ?", *line);
+ else d += sprintf(d, "\\u%d ?", *line); //!!!!!!!!!!
}
*(d++) = '}';
@@ -239,7 +239,7 @@ static char *SetToStyle(int style) LOGFONT lf;
LoadMsgDlgFont(style, &lf, NULL);
- 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;
}
@@ -606,9 +606,10 @@ void LoadMsgLogIcons(void) for (i = 0; i < SIZEOF(pLogIconBmpBits); i++) {
hIcon = Skin_GetIconByHandle(iconList[i].hIcolib);
- pLogIconBmpBits[i] = (PBYTE) mir_alloc(RTFPICTHEADERMAXSIZE + (bih.biSize + widthBytes * bih.biHeight) * 2);
+ size_t size = RTFPICTHEADERMAXSIZE + (bih.biSize + widthBytes * bih.biHeight) * 2;
+ pLogIconBmpBits[i] = (PBYTE) mir_alloc(size);
//I can't seem to get binary mode working. No matter.
- rtfHeaderSize = sprintf((char*)pLogIconBmpBits[i], "{\\pict\\dibitmap0\\wbmbitspixel%u\\wbmplanes1\\wbmwidthbytes%u\\picw%u\\pich%u ", bih.biBitCount, widthBytes, bih.biWidth, bih.biHeight);
+ rtfHeaderSize = mir_snprintf((char*)pLogIconBmpBits[i], size, "{\\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, 0, hIcon, bih.biWidth, bih.biHeight, 0, NULL, DI_NORMAL);
@@ -619,9 +620,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] = '}';
|