mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2025-07-26 22:24:40 +00:00
trim whitespace from server info responses
This commit is contained in:
parent
fd9ee45dac
commit
f43c74d59b
@ -18,11 +18,11 @@
|
||||
}
|
||||
|
||||
- (void) populateHost:(Host*)host {
|
||||
host.name = [self getStringTag:TAG_HOSTNAME];
|
||||
host.externalAddress = [self getStringTag:TAG_EXTERNAL_IP];
|
||||
host.localAddress = [self getStringTag:TAG_LOCAL_IP];
|
||||
host.uuid = [self getStringTag:TAG_UNIQUE_ID];
|
||||
host.mac = [self getStringTag:TAG_MAC_ADDRESS];
|
||||
host.name = [[self getStringTag:TAG_HOSTNAME] trim];
|
||||
host.externalAddress = [[self getStringTag:TAG_EXTERNAL_IP] trim];
|
||||
host.localAddress = [[self getStringTag:TAG_LOCAL_IP] trim];
|
||||
host.uuid = [[self getStringTag:TAG_UNIQUE_ID] trim];
|
||||
host.mac = [[self getStringTag:TAG_MAC_ADDRESS] trim];
|
||||
|
||||
NSInteger pairStatus;
|
||||
if ([self getIntTag:TAG_PAIR_STATUS value:&pairStatus]) {
|
||||
|
@ -24,3 +24,9 @@ FOUNDATION_EXPORT NSString *const deviceName;
|
||||
+ (int) resolveHost:(NSString*)host;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSString (NSStringWithTrim)
|
||||
|
||||
- (NSString*) trim;
|
||||
|
||||
@end
|
@ -73,5 +73,12 @@ NSString *const deviceName = @"roth";
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSString (NSStringWithTrim)
|
||||
|
||||
- (NSString *)trim {
|
||||
return [self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
Loading…
x
Reference in New Issue
Block a user