diff options
author | George Hazan <george.hazan@gmail.com> | 2013-08-15 08:01:11 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-08-15 08:01:11 +0000 |
commit | c68165979e5741aa201a9ac951e37fee4ca362cc (patch) | |
tree | 61313e23466d16a31904b442ca2ee20f738926c9 /protocols/Gadu-Gadu/src/avatar.cpp | |
parent | 6082f8c569cd3df0ebdcec61a223027868207473 (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 'protocols/Gadu-Gadu/src/avatar.cpp')
-rw-r--r-- | protocols/Gadu-Gadu/src/avatar.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp index 42685a821f..400182613c 100644 --- a/protocols/Gadu-Gadu/src/avatar.cpp +++ b/protocols/Gadu-Gadu/src/avatar.cpp @@ -109,18 +109,14 @@ bool GGPROTO::getAvatarFileInfo(uin_t uin, char **avatarurl, char **avatarts) char *gg_avatarhash(char *param)
{
- mir_sha1_byte_t digest[MIR_SHA1_HASH_SIZE];
char *result;
- int i;
if (param == NULL || (result = (char *)mir_alloc(MIR_SHA1_HASH_SIZE * 2 + 1)) == NULL)
return NULL;
+ mir_sha1_byte_t digest[MIR_SHA1_HASH_SIZE];
mir_sha1_hash((BYTE*)param, (int)strlen(param), digest);
- for (i = 0; i < MIR_SHA1_HASH_SIZE; i++)
- mir_snprintf(result + (i<<1), 2, "%02x", digest[i]);
-
- return result;
+ return bin2hex(digest, sizeof(digest), result);
}
void GGPROTO::requestAvatarTransfer(HANDLE hContact, char *szAvatarURL)
|