File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -321,35 +321,34 @@ - (NSStreamStatus) streamStatus
321321- (NSString *) _stringFromEvents
322322{
323323 NSMutableString *s = [NSMutableString stringWithCapacity: 100 ];
324- BOOL bits = 0 ;
325324
326325 if (0 == _events)
327326 {
328327 return @" None" ;
329328 }
330329 if (_events & NSStreamEventOpenCompleted)
331330 {
332- if (bits++ > 0 ) [s appendString: @" |" ];
331+ if ([s length ] > 0 ) [s appendString: @" |" ];
333332 [s appendString: @" OpenCompleted" ];
334333 }
335334 if (_events & NSStreamEventHasBytesAvailable)
336335 {
337- if (bits++ > 0 ) [s appendString: @" |" ];
336+ if ([s length ] > 0 ) [s appendString: @" |" ];
338337 [s appendString: @" HasBytesAvailable" ];
339338 }
340339 if (_events & NSStreamEventHasSpaceAvailable)
341340 {
342- if (bits++ > 0 ) [s appendString: @" |" ];
341+ if ([s length ] > 0 ) [s appendString: @" |" ];
343342 [s appendString: @" HasSpaceAvailable" ];
344343 }
345344 if (_events & NSStreamEventErrorOccurred)
346345 {
347- if (bits++ > 0 ) [s appendString: @" |" ];
346+ if ([s length ] > 0 ) [s appendString: @" |" ];
348347 [s appendString: @" ErrorOccurred" ];
349348 }
350349 if (_events & NSStreamEventEndEncountered)
351350 {
352- if (bits++ > 0 ) [s appendString: @" |" ];
351+ if ([s length ] > 0 ) [s appendString: @" |" ];
353352 [s appendString: @" EndEncountered" ];
354353 }
355354 return s;
Original file line number Diff line number Diff line change @@ -4964,7 +4964,7 @@ - (NSString*) stringByExpandingTildeInPath
49644964{
49654965 NSString *homedir;
49664966 NSRange firstSlashRange;
4967- unsigned length;
4967+ NSUInteger length;
49684968
49694969 if ((length = [self length ]) == 0 )
49704970 {
@@ -5004,8 +5004,8 @@ - (NSString*) stringByExpandingTildeInPath
50045004 if (firstSlashRange.location != 1 )
50055005 {
50065006 /* It is of the form `~username/blah/...' or '~username' */
5007- int userNameLen;
5008- NSString *uname;
5007+ NSUInteger userNameLen;
5008+ NSString *uname;
50095009
50105010 if (firstSlashRange.length != 0 )
50115011 {
@@ -5014,8 +5014,8 @@ - (NSString*) stringByExpandingTildeInPath
50145014 else
50155015 {
50165016 /* It is actually of the form `~username' */
5017- userNameLen = [ self length ] - 1 ;
5018- firstSlashRange.location = [ self length ] ;
5017+ userNameLen = length - 1 ;
5018+ firstSlashRange.location = length;
50195019 }
50205020 uname = [self substringWithRange: ((NSRange ){1 , userNameLen})];
50215021 homedir = NSHomeDirectoryForUser (uname);
You can’t perform that action at this time.
0 commit comments