summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_console.cpp
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2014-12-08 22:13:57 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2014-12-08 22:13:57 +0000
commit13eb83bea655c3302c74a82d826d75bceb9232a2 (patch)
treeea992cbd9002e078a06e9fe65a73698eec4fbc22 /protocols/JabberG/src/jabber_console.cpp
parentef741fcb36d679b094e44d01714f423c34357383 (diff)
code cleanup around mir_snprintf
git-svn-id: http://svn.miranda-ng.org/main/trunk@11285 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_console.cpp')
-rw-r--r--protocols/JabberG/src/jabber_console.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp
index 304e48f770..bc5cf87266 100644
--- a/protocols/JabberG/src/jabber_console.cpp
+++ b/protocols/JabberG/src/jabber_console.cpp
@@ -195,8 +195,8 @@ static void sttEmptyBuf(StringBuf *buf)
static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent)
{
- char *indentLevel = (char *)mir_alloc(128);
- mir_snprintf(indentLevel, 128, RTF_INDENT_FMT, (int)(indent*200));
+ char indentLevel[128];
+ mir_snprintf(indentLevel, SIZEOF(indentLevel), RTF_INDENT_FMT, (int)(indent*200));
sttAppendBufRaw(buf, RTF_BEGINTAG);
sttAppendBufRaw(buf, indentLevel);
@@ -229,10 +229,9 @@ static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent)
if (xmlGetText(node)) {
if (xmlGetChildCount(node)) {
sttAppendBufRaw(buf, RTF_BEGINTEXT);
- char *indentTextLevel = (char *)mir_alloc(128);
- mir_snprintf(indentTextLevel, 128, RTF_TEXTINDENT_FMT, (int)((indent + 1) * 200));
+ char indentTextLevel[128];
+ mir_snprintf(indentTextLevel, SIZEOF(indentTextLevel), RTF_TEXTINDENT_FMT, (int)((indent + 1) * 200));
sttAppendBufRaw(buf, indentTextLevel);
- mir_free(indentTextLevel);
}
sttAppendBufT(buf, xmlGetText(node));
@@ -255,7 +254,6 @@ static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent)
else sttAppendBufRaw(buf, " />");
sttAppendBufRaw(buf, RTF_ENDTAG);
- mir_free(indentLevel);
}
DWORD CALLBACK sttStreamInCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)