Merging in a fix to a bug which caused the user agent string not to be null-terminated.

This commit is contained in:
Andy Matuschak committed 2009-05-19 11:44:02 -07:00
commit dff6e0832c
1 file changed
+1 -1
+1 -1
View File
@@ -32,7 +32,7 @@
[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] encoding:NSASCIIStringEncoding];
userAgent = [[[NSString alloc] initWithData:cleanedAgent encoding:NSASCIIStringEncoding] autorelease];
[appcast setUserAgentString:userAgent];
[appcast fetchAppcastFromURL:URL];
}