From 980674374d043dcdd6b745d89d22cf7094fe168a Mon Sep 17 00:00:00 2001 From: rentzsch Date: Mon, 4 May 2009 12:04:12 -0500 Subject: [PATCH] [FIX] Replace use of deprecated methods. (Jacques Vidrine via https://twitter.com/EACCES/status/1697243619) --- Sparkle/SUBasicUpdateDriver.m | 2 +- Sparkle/SUHost.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sparkle/SUBasicUpdateDriver.m b/Sparkle/SUBasicUpdateDriver.m index 9a1dc66b..2409740c 100644 --- a/Sparkle/SUBasicUpdateDriver.m +++ b/Sparkle/SUBasicUpdateDriver.m @@ -32,7 +32,7 @@ - (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)aHost [appcast setDelegate:self]; NSString *userAgent = [NSString stringWithFormat: @"%@/%@ Sparkle/%@", [aHost name], [aHost displayVersion], ([SPARKLE_BUNDLE objectForInfoDictionaryKey:@"CFBundleVersion"] ?: nil)]; NSData * cleanedAgent = [userAgent dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; - userAgent = [NSString stringWithCString:[cleanedAgent bytes] length:[cleanedAgent length]]; + userAgent = [[NSString alloc] initWithData:cleanedAgent encoding:NSASCIIStringEncoding]; [appcast setUserAgentString:userAgent]; [appcast fetchAppcastFromURL:URL]; } diff --git a/Sparkle/SUHost.m b/Sparkle/SUHost.m index 3f8f91db..90334078 100644 --- a/Sparkle/SUHost.m +++ b/Sparkle/SUHost.m @@ -111,7 +111,7 @@ - (NSString *)publicDSAKey // More likely, we've got a reference to a Resources file by filename: NSString *keyFilename = [self objectForInfoDictionaryKey:SUPublicDSAKeyFileKey]; if (!keyFilename) { return nil; } - return [NSString stringWithContentsOfFile:[bundle pathForResource:keyFilename ofType:nil]]; + return [NSString stringWithContentsOfFile:[bundle pathForResource:keyFilename ofType:nil] encoding:NSASCIIStringEncoding error:NULL]; } - (NSArray *)systemProfile