Skip to content

Commit

Permalink
Fixed small bug in hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
Erica Sadun authored and Erica Sadun committed Nov 30, 2009
1 parent 530217a commit b9c664a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions Apple Sample Code/wwanconnect.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static void MyCFWriteStreamClientCallBack(CFWriteStreamRef stream, CFStreamEvent
{
MyStreamInfoPtr myInfoPtr = (MyStreamInfoPtr) clientCallBackInfo;

printf("MyCFWriteStreamClientCallBack entered - event is %d\n", type);
printf("MyCFWriteStreamClientCallBack entered - event is %d\n", (int) type);

switch (type)
{
Expand All @@ -97,11 +97,10 @@ static void MyCFWriteStreamClientCallBack(CFWriteStreamRef stream, CFStreamEvent
case kCFStreamEventErrorOccurred:
myInfoPtr->errorOccurred = TRUE;
myInfoPtr->error = CFWriteStreamGetError(myInfoPtr->wStreamRef);
printf("write stream error %d .. giving up\n", myInfoPtr->error.error);
printf("write stream error %d .. giving up\n", (int)myInfoPtr->error.error);
break;

default:
printf("event type %d occurred\n");
break;
}
// stop the run loop at this point
Expand Down
7 changes: 3 additions & 4 deletions UIDevice-Reachability.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,11 @@ - (NSString *) hostname
char baseHostName[255];
int success = gethostname(baseHostName, 255);
if (success != 0) return nil;
baseHostName[255] = '\0';

#if !TARGET_IPHONE_SIMULATOR
return [NSString stringWithFormat:@"%s.local", baseHostName];
#else
#if TARGET_IPHONE_SIMULATOR
return [NSString stringWithFormat:@"%s", baseHostName];
#else
return [NSString stringWithFormat:@"%s.local", baseHostName];
#endif
}

Expand Down

0 comments on commit b9c664a

Please sign in to comment.