From 41a7300678e4bb3cd703e2c236e57af4a31962c7 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Mon, 1 Dec 2014 04:50:22 +0000 Subject: mir_snprintf(..., sizeof() -> SIZEOF(), ...) small fixs cleanups git-svn-id: http://svn.miranda-ng.org/main/trunk@11188 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tlen/src/tlen_picture.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'protocols/Tlen/src/tlen_picture.cpp') diff --git a/protocols/Tlen/src/tlen_picture.cpp b/protocols/Tlen/src/tlen_picture.cpp index f97cc1fb78..0d39b3db7f 100644 --- a/protocols/Tlen/src/tlen_picture.cpp +++ b/protocols/Tlen/src/tlen_picture.cpp @@ -34,7 +34,7 @@ static void LogPictureMessage(TlenProtocol *proto, const char *jid, const char * { char message[1024]; const char *msg = isSent ? LPGEN("Image sent file://%s") : LPGEN("Image received file://%s"); - mir_snprintf(message, sizeof(message), Translate(msg), filename); + mir_snprintf(message, SIZEOF(message), Translate(msg), filename); TlenLogMessage(proto, TlenHContactFromJID(proto, jid), isSent ? DBEF_SENT : 0, message); } @@ -49,8 +49,8 @@ static void TlenPsPostThread(void *ptr) { DWORD ret; item->ft->s = socket; item->ft->hFileEvent = CreateEvent(NULL, FALSE, FALSE, NULL); - mir_snprintf(header, sizeof(header), "", proto->threadData->username, item->ft->jid, item->ft->fileTotalSize, item->jid); - TlenWsSend(proto, socket, header, (int)strlen(header)); + ret = mir_snprintf(header, SIZEOF(header), "", proto->threadData->username, item->ft->jid, item->ft->fileTotalSize, item->jid); + TlenWsSend(proto, socket, header, (int)ret); ret = WaitForSingleObject(item->ft->hFileEvent, 1000 * 60 * 5); if (ret == WAIT_OBJECT_0) { FILE *fp = fopen( item->ft->files[0], "rb" ); @@ -58,8 +58,8 @@ static void TlenPsPostThread(void *ptr) { int i; char header[512]; char fileBuffer[2048]; - mir_snprintf(header, sizeof(header), "", item->ft->iqId, item->jid); - TlenWsSend(proto, socket, header, (int)strlen(header)); + i = mir_snprintf(header, SIZEOF(header), "", item->ft->iqId, item->jid); + TlenWsSend(proto, socket, header, i); proto->debugLogA("Sending picture data..."); for (i = item->ft->filesSize[0]; i > 0; ) { int toread = min(2048, i); @@ -114,8 +114,8 @@ static void TlenPsGetThread(void *ptr) { char header[512]; char fileBuffer[2048]; TlenXmlInitState(&xmlState); - mir_snprintf(header, sizeof(header), "", proto->threadData->username, item->ft->jid, item->jid, item->ft->id2); - TlenWsSend(proto, socket, header, (int)strlen(header)); + int header_len = mir_snprintf(header, SIZEOF(header), "", proto->threadData->username, item->ft->jid, item->jid, item->ft->id2); + TlenWsSend(proto, socket, header, header_len); proto->debugLogA("Reveiving picture data..."); { int totalcount = 0; @@ -284,7 +284,7 @@ BOOL SendPicture(TlenProtocol *proto, MCONTACT hContact) { char idStr[10]; char fileBuffer[2048]; int id = TlenSerialNext(proto); - mir_snprintf(idStr, sizeof(idStr), "%d", id); + mir_snprintf(idStr, SIZEOF(idStr), "%d", id); item = TlenListAdd(proto, LIST_PICTURE, idStr); item->ft = TlenFileCreateFT(proto, jid); item->ft->files = (char **) mir_alloc(sizeof(char *)); -- cgit v1.2.3