summaryrefslogtreecommitdiff
path: root/plugins/YAMN/src/proto/pop3/pop3.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-08-15 08:01:11 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-08-15 08:01:11 +0000
commitc68165979e5741aa201a9ac951e37fee4ca362cc (patch)
tree61313e23466d16a31904b442ca2ee20f738926c9 /plugins/YAMN/src/proto/pop3/pop3.cpp
parent6082f8c569cd3df0ebdcec61a223027868207473 (diff)
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
Diffstat (limited to 'plugins/YAMN/src/proto/pop3/pop3.cpp')
-rw-r--r--plugins/YAMN/src/proto/pop3/pop3.cpp12
1 files changed, 4 insertions, 8 deletions
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)