~ubuntu-branches/ubuntu/intrepid/curl/intrepid

« back to all changes in this revision

Viewing changes to lib/base64.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2006-10-30 10:56:48 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20061030105648-uo8q8w9xklb40b4k
Tags: 7.15.5-1ubuntu1
* Merge from debian unstable. Remaining Ubuntu changes:
  - debian/control: Drop libdb4.2 build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
 * KIND, either express or implied.
20
20
 *
21
 
 * $Id: base64.c,v 1.35 2005/03/31 07:02:03 bagder Exp $
 
21
 * $Id: base64.c,v 1.36 2006-07-19 21:14:02 yangtse Exp $
22
22
 ***************************************************************************/
23
23
 
24
24
/* Base64 encoding/decoding
177
177
        ibuf[i] = 0;
178
178
    }
179
179
 
180
 
    obuf [0] = (ibuf [0] & 0xFC) >> 2;
181
 
    obuf [1] = ((ibuf [0] & 0x03) << 4) | ((ibuf [1] & 0xF0) >> 4);
182
 
    obuf [2] = ((ibuf [1] & 0x0F) << 2) | ((ibuf [2] & 0xC0) >> 6);
183
 
    obuf [3] = ibuf [2] & 0x3F;
 
180
    obuf[0] = (unsigned char)  ((ibuf[0] & 0xFC) >> 2);
 
181
    obuf[1] = (unsigned char) (((ibuf[0] & 0x03) << 4) | \
 
182
                               ((ibuf[1] & 0xF0) >> 4));
 
183
    obuf[2] = (unsigned char) (((ibuf[1] & 0x0F) << 2) | \
 
184
                               ((ibuf[2] & 0xC0) >> 6));
 
185
    obuf[3] = (unsigned char)   (ibuf[2] & 0x3F);
184
186
 
185
187
    switch(inputparts) {
186
188
    case 1: /* only one byte read */