From b78c3f9d33055e436bdd70bb3aa9c22cc0af3aed Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 5 Dec 2014 16:00:04 +0000 Subject: warning fix git-svn-id: http://svn.miranda-ng.org/main/trunk@11253 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_console.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'protocols') diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp index 97b027f82a..304e48f770 100644 --- a/protocols/JabberG/src/jabber_console.cpp +++ b/protocols/JabberG/src/jabber_console.cpp @@ -44,9 +44,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct StringBuf { char *buf; - int size; - int offset; - int streamOffset; + size_t size, offset, streamOffset; }; static void sttAppendBufRaw(StringBuf *buf, const char *str); @@ -263,13 +261,14 @@ static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent) DWORD CALLBACK sttStreamInCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb) { StringBuf *buf = (StringBuf *)dwCookie; - *pcb = 0; if (buf->streamOffset < buf->offset) { - *pcb = min(cb, buf->offset - buf->streamOffset); - memcpy(pbBuff, buf->buf + buf->streamOffset, *pcb); - buf->streamOffset += *pcb; + size_t cbLen = min(size_t(cb), buf->offset - buf->streamOffset); + memcpy(pbBuff, buf->buf + buf->streamOffset, cbLen); + buf->streamOffset += cbLen; + *pcb = (LONG)cbLen; } + else *pcb = 0; return 0; } -- cgit v1.2.3