From 52f7a0cce8d46ea0d2b6b1acdcc472f25bd63d81 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Wed, 12 Jan 2005 10:11:04 -0500 Subject: BUG: encoding 2 bytes into 4 bytes was accessing a 3rd byte from the source --- Source/kwsys/Base64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/Base64.c b/Source/kwsys/Base64.c index 999c3f5..0c5e44f 100644 --- a/Source/kwsys/Base64.c +++ b/Source/kwsys/Base64.c @@ -87,7 +87,7 @@ void kwsysBase64_Encode2(const unsigned char *src, unsigned char *dest) { dest[0] = kwsysBase64EncodeChar((src[0] >> 2) & 0x3F); dest[1] = kwsysBase64EncodeChar(((src[0] << 4) & 0x30)|((src[1] >> 4) & 0x0F)); - dest[2] = kwsysBase64EncodeChar(((src[1] << 2) & 0x3C)|((src[2] >> 6) & 0x03)); + dest[2] = kwsysBase64EncodeChar(((src[1] << 2) & 0x3C)); dest[3] = '='; } -- cgit v0.12