summaryrefslogtreecommitdiff
path: root/protocols/Tlen/src/tlen_p2p_old.cpp
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2014-12-01 04:50:22 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2014-12-01 04:50:22 +0000
commit41a7300678e4bb3cd703e2c236e57af4a31962c7 (patch)
tree36318f807498cf15b405eda5c451fd37bfe1b675 /protocols/Tlen/src/tlen_p2p_old.cpp
parent97e0ada5c34d6e7eba1cf47a8d8ac029197be6de (diff)
mir_snprintf(..., sizeof() -> SIZEOF(), ...)
small fixs cleanups git-svn-id: http://svn.miranda-ng.org/main/trunk@11188 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tlen/src/tlen_p2p_old.cpp')
-rw-r--r--protocols/Tlen/src/tlen_p2p_old.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/protocols/Tlen/src/tlen_p2p_old.cpp b/protocols/Tlen/src/tlen_p2p_old.cpp
index c8ca8df1dd..e8bea6e2cb 100644
--- a/protocols/Tlen/src/tlen_p2p_old.cpp
+++ b/protocols/Tlen/src/tlen_p2p_old.cpp
@@ -155,6 +155,7 @@ void TlenP2PEstablishOutgoingConnection(TLEN_FILE_TRANSFER *ft, BOOL sendAck)
{
char *hash;
char str[300];
+ size_t srt_len;
TLEN_FILE_PACKET *packet;
TlenProtocol *proto = ft->proto;
@@ -164,8 +165,8 @@ void TlenP2PEstablishOutgoingConnection(TLEN_FILE_TRANSFER *ft, BOOL sendAck)
TlenP2PPacketSetType(packet, TLEN_FILE_PACKET_CONNECTION_REQUEST);
TlenP2PPacketPackDword(packet, 1);
TlenP2PPacketPackDword(packet, (DWORD) atoi(ft->iqId));
- mir_snprintf(str, sizeof(str), "%08X%s%d", atoi(ft->iqId), proto->threadData->username, atoi(ft->iqId));
- hash = TlenSha1(str, (int)strlen(str));
+ srt_len = mir_snprintf(str, SIZEOF(str), "%08X%s%d", atoi(ft->iqId), proto->threadData->username, atoi(ft->iqId));
+ hash = TlenSha1(str, (int)srt_len);
TlenP2PPacketPackBuffer(packet, hash, 20);
mir_free(hash);
TlenP2PPacketSend(ft->s, packet);
@@ -208,14 +209,14 @@ TLEN_FILE_TRANSFER* TlenP2PEstablishIncomingConnection(TlenProtocol *proto, HAND
i = 0;
while ((i=TlenListFindNext(proto, list, i)) >= 0) {
if ((item=TlenListGetItemPtrFromIndex(proto, i)) != NULL) {
- mir_snprintf(str, sizeof(str), "%d", iqId);
+ mir_snprintf(str, SIZEOF(str), "%d", iqId);
if (!strcmp(item->ft->iqId, str)) {
char *hash, *nick;
int j;
nick = TlenNickFromJID(item->ft->jid);
- mir_snprintf(str, sizeof(str), "%08X%s%d", iqId, nick, iqId);
+ j = mir_snprintf(str, SIZEOF(str), "%08X%s%d", iqId, nick, iqId);
mir_free(nick);
- hash = TlenSha1(str, (int)strlen(str));
+ hash = TlenSha1(str, j);
for (j=0;j<20;j++) {
if (hash[j] != packet->packet[2*sizeof(DWORD)+j]) break;
}