# HG changeset patch # User Eric Warmenhoven # Date 989402178 0 # Node ID bdfb37ae28b48498d6c6a1070cce71c3ef27db88 # Parent 6438722696163869b5d54d83a2b7a4432b0552e2 [gaim-migrate @ 1839] not that anything uses this committer: Tailor Script diff -r 643872269616 -r bdfb37ae28b4 src/util.c --- a/src/util.c Wed May 09 05:24:50 2001 +0000 +++ b/src/util.c Wed May 09 09:56:18 2001 +0000 @@ -591,7 +591,7 @@ c = text; - while (c) { + while (*c) { tmp = tmp << 8; tmp += *c; n++; @@ -611,17 +611,19 @@ switch (n) { case 2: + tmp <<= 8; out = g_realloc(out, len + 5); - out[len] = alphabet[(tmp >> 12) & 0x3f]; - out[len + 1] = alphabet[(tmp >> 6) & 0x3f]; - out[len + 2] = alphabet[tmp & 0x3f]; + out[len] = alphabet[(tmp >> 18) & 0x3f]; + out[len + 1] = alphabet[(tmp >> 12) & 0x3f]; + out[len + 2] = alphabet[(tmp >> 6) & 0x3f]; out[len + 3] = '='; out[len + 4] = 0; break; case 1: + tmp <<= 16; out = g_realloc(out, len + 4); - out[len] = alphabet[(tmp >> 6) & 0x3f]; - out[len + 1] = alphabet[tmp & 0x3f]; + out[len] = alphabet[(tmp >> 12) & 0x3f]; + out[len + 1] = alphabet[(tmp >> 6) & 0x3f]; out[len + 2] = '='; out[len + 3] = 0; break;