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
1 changed files with 4 additions and 2 deletions

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];