From c68165979e5741aa201a9ac951e37fee4ca362cc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 15 Aug 2013 08:01:11 +0000 Subject: we use bin2hex now instead of mir_snprintf("%02x") git-svn-id: http://svn.miranda-ng.org/main/trunk@5699 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/YAMN/src/proto/pop3/pop3.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'plugins/YAMN/src/proto') diff --git a/plugins/YAMN/src/proto/pop3/pop3.cpp b/plugins/YAMN/src/proto/pop3/pop3.cpp index 8ca1f2bfb2..a66c85e7af 100644 --- a/plugins/YAMN/src/proto/pop3/pop3.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3.cpp @@ -238,7 +238,6 @@ char* CPop3Client::APOP(char* name, char* pw, char* timestamp) char query[512]; char *Result; unsigned char digest[16]; - char hexdigest[40]; if (timestamp==NULL) throw POP3Error=(DWORD)EPOP3_APOP; @@ -247,13 +246,10 @@ char* CPop3Client::APOP(char* name, char* pw, char* timestamp) mir_md5_append(&ctx,(const unsigned char *)timestamp,(unsigned int)strlen(timestamp)); mir_md5_append(&ctx,(const unsigned char *)pw,(unsigned int)strlen(pw)); mir_md5_finish(&ctx, digest); - hexdigest[0]='\0'; - for (int i=0; i < 16; i++) { - char tmp[4]; - mir_snprintf(tmp, SIZEOF(tmp), "%02x", digest[i]); - strcat(hexdigest, tmp); - } - mir_snprintf(query, SIZEOF(query), "APOP %s %s\r\n", name, hexdigest); + + char hexdigest[40]; + mir_snprintf(query, SIZEOF(query), "APOP %s %s\r\n", name, bin2hex(digest, sizeof(digest), hexdigest)); + NetClient->Send(query); Result=RecvRest(NetClient->Recv(),POP3_SEARCHACK); if (AckFlag==POP3_FERR) -- cgit v1.2.3