BUG: encoding 2 bytes into 4 bytes was accessing a 3rd byte from the source

This commit is contained in:
Jim Miller 2005-01-12 10:11:04 -05:00
parent f51a308d72
commit 52f7a0cce8
1 changed files with 1 additions and 1 deletions

View File

@ -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] = '=';
}