Permalink
Browse files

Fix uninitialized-variable error

The version of Clang in Xcode 4.6 now complains about usage of an
uninitialized variable 'hasBytesAvailable' in -[GCDAsyncSocket doReadData].
This breaks compilation. I've added a few lines to initialize the variable.
  • Loading branch information...
snej committed Feb 5, 2013
1 parent 6625620 commit 5f8386d0677049bd1198ad9f4c1c5966d809d22a
Showing with 3 additions and 6 deletions.
  1. +3 −6 Vendor/CocoaAsyncSocket/GCDAsyncSocket.m
@@ -4213,16 +4213,13 @@ - (void)doReadData
if ([self usingCFStreamForTLS])
{
+ hasBytesAvailable = NO;
+ estimatedBytesAvailable = 0;
#if TARGET_OS_IPHONE
-
// Relegated to using CFStream... :( Boo! Give us a full SecureTransport stack Apple!
-
- estimatedBytesAvailable = 0;
+
if ((flags & kSecureSocketHasBytesAvailable) && CFReadStreamHasBytesAvailable(readStream))
hasBytesAvailable = YES;
- else
- hasBytesAvailable = NO;
-
#endif
}
else

0 comments on commit 5f8386d

Please sign in to comment.