Search code examples
iphoneios5mgtwitterengine

Logic Error: The left operand of '&' is a garbage value


I used Twitter-OAuth-iPhone to synchronize the message in my app. It's all right in iOS4.
After upgraded to iOS5, choose menu 'Product' > 'Analyze', and got a few warnings.

In NSData+Base64.m, It's warning 'The left operand of '&' is a garbage value' enter image description here

Codes here:

if( ixinbuf == 4 ) {
ixinbuf = 0;
outbuf [0] = ( inbuf[0] << 2 ) | ( ( inbuf[1] & 0x30) >> 4 );
outbuf [1] = ( ( inbuf[1] & 0x0F ) << 4 ) | ( ( inbuf[2] & 0x3C ) >> 2 );
outbuf [2] = ( ( inbuf[2] & 0x03 ) << 6 ) | ( inbuf[3] & 0x3F );

for( i = 0; i < ctcharsinbuf; i++ ) 
    [mutableData appendBytes:&outbuf[i] length:1];
}

And there are other error message: error

Sorry I am a novice and have no any clue about these problems.
Would you help me fix it please?
Many THANKS!

Edit------------
Logic loop screenshot:

removing dead ImageShack link

Full Codes: https://github.com/bengottlieb/Twitter-OAuth-iPhone/blob/master/Twitter+OAuth/MGTwitterEngine/NSData+Base64.m

Thanks any suggestion!


Solution

  • sidestep it by initializing inbuf to an empty char array:

    unsigned char inbuf[4] = {};
    unsigned char outbuf[3];