Skip to content

Commit 9806743

Browse files
committed
[FIX] Replace use of deprecated methods. (Jacques Vidrine via https://twitter.com/EACCES/status/1697243619)
1 parent 2d74d2b commit 9806743

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sparkle/SUBasicUpdateDriver.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ - (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)aHost
3232
[appcast setDelegate:self];
3333
NSString *userAgent = [NSString stringWithFormat: @"%@/%@ Sparkle/%@", [aHost name], [aHost displayVersion], ([SPARKLE_BUNDLE objectForInfoDictionaryKey:@"CFBundleVersion"] ?: nil)];
3434
NSData * cleanedAgent = [userAgent dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
35-
userAgent = [NSString stringWithCString:[cleanedAgent bytes] length:[cleanedAgent length]];
35+
userAgent = [[NSString alloc] initWithData:cleanedAgent encoding:NSASCIIStringEncoding];
3636
[appcast setUserAgentString:userAgent];
3737
[appcast fetchAppcastFromURL:URL];
3838
}

Sparkle/SUHost.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ - (NSString *)publicDSAKey
111111
// More likely, we've got a reference to a Resources file by filename:
112112
NSString *keyFilename = [self objectForInfoDictionaryKey:SUPublicDSAKeyFileKey];
113113
if (!keyFilename) { return nil; }
114-
return [NSString stringWithContentsOfFile:[bundle pathForResource:keyFilename ofType:nil]];
114+
return [NSString stringWithContentsOfFile:[bundle pathForResource:keyFilename ofType:nil] encoding:NSASCIIStringEncoding error:NULL];
115115
}
116116

117117
- (NSArray *)systemProfile

0 commit comments

Comments
 (0)