Skip to content

Commit 8422fae

Browse files
committed
Fix for Google Code issue robbiehanson#126 - connectToHost with empty host string
1 parent be2a695 commit 8422fae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

GCD/GCDAsyncSocket.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,9 +1806,9 @@ - (BOOL)connectToHost:(NSString *)inHost
18061806

18071807
// Check for problems with host parameter
18081808

1809-
if (host == nil)
1809+
if ([host length] == 0)
18101810
{
1811-
NSString *msg = @"Invalid host parameter (nil). Should be a domain name or IP address string.";
1811+
NSString *msg = @"Invalid host parameter (nil or \"\"). Should be a domain name or IP address string.";
18121812
err = [[self badParamError:msg] retain];
18131813

18141814
[pool drain];

0 commit comments

Comments
 (0)