1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 08:13:27 +00:00

Use -[[NSFileManager defaultManager] stringWithFileSystemRepresentation:length:] in one other place.

This commit is contained in:
C.W. Betts 2019-07-28 16:13:57 -06:00
parent 751200f59a
commit 33b792531d

View file

@ -4581,8 +4581,10 @@ static void removeKeRangerRansomware()
- (void) rpcAddTorrentStruct: (struct tr_torrent *) torrentStruct
{
NSString * location = nil;
if (tr_torrentGetDownloadDir(torrentStruct) != NULL)
location = @(tr_torrentGetDownloadDir(torrentStruct));
if (tr_torrentGetDownloadDir(torrentStruct) != NULL) {
const char * tmpLoc = tr_torrentGetDownloadDir(torrentStruct);
location = [[NSFileManager defaultManager] stringWithFileSystemRepresentation: tmpLoc length: strlen(tmpLoc)];
}
Torrent * torrent = [[Torrent alloc] initWithTorrentStruct: torrentStruct location: location lib: fLib];