From 13eb83bea655c3302c74a82d826d75bceb9232a2 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Mon, 8 Dec 2014 22:13:57 +0000 Subject: code cleanup around mir_snprintf git-svn-id: http://svn.miranda-ng.org/main/trunk@11285 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_console.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'protocols/JabberG/src') 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) -- cgit v1.2.3