summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-12-05 16:00:04 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-12-05 16:00:04 +0000
commitb78c3f9d33055e436bdd70bb3aa9c22cc0af3aed (patch)
tree5e7837deca86cb73133782902746041e54cfc3cb
parent7c3775ae24f772f37ee69632f11292bd59ebccd2 (diff)
warning fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@11253 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/JabberG/src/jabber_console.cpp13
1 files changed, 6 insertions, 7 deletions
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;
}