summaryrefslogtreecommitdiff
path: root/plugins/SecureIM/src/splitmsg.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 /plugins/SecureIM/src/splitmsg.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 'plugins/SecureIM/src/splitmsg.cpp')
-rw-r--r--plugins/SecureIM/src/splitmsg.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/SecureIM/src/splitmsg.cpp b/plugins/SecureIM/src/splitmsg.cpp
index 259d636955..64e1577ad9 100644
--- a/plugins/SecureIM/src/splitmsg.cpp
+++ b/plugins/SecureIM/src/splitmsg.cpp
@@ -5,16 +5,16 @@ LPSTR splitMsg(LPSTR szMsg, int iLen)
{
Sent_NetLog("split: msg: -----\n%s\n-----\n", szMsg);
- int len = (int)strlen(szMsg);
+ size_t len = strlen(szMsg);
LPSTR out = (LPSTR)mir_alloc(len * 2);
LPSTR buf = out;
WORD msg_id = db_get_w(0, MODULENAME, "msgid", 0) + 1;
db_set_w(0, MODULENAME, "msgid", msg_id);
- int part_all = (len + iLen - 1) / iLen;
- for (int part_num = 0; part_num<part_all; part_num++) {
- int sz = (len>iLen) ? iLen : len;
+ size_t part_all = (len + iLen - 1) / iLen;
+ for (size_t part_num = 0; part_num<part_all; part_num++) {
+ size_t sz = (len>iLen) ? iLen : len;
mir_snprintf(buf, 32, "%s%04X%02X%02X", SIG_SECP, msg_id, part_num, part_all);
memcpy(buf + LEN_SECP + 8, szMsg, sz);
*(buf + LEN_SECP + 8 + sz) = '\0';