1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 01:03:01 +00:00

#4422 On Mac, tr_getWebClientDir() uses incorrect encoding for creating the web content dir path

This commit is contained in:
Mitchell Livingston 2011-08-15 00:10:06 +00:00
parent 177f2398a5
commit fbfae34837

View file

@ -571,14 +571,10 @@ tr_getWebClientDir( const tr_session * session UNUSED )
CFURLRef appURL = CFBundleCopyBundleURL( CFBundleGetMainBundle( ) );
CFStringRef appRef = CFURLCopyFileSystemPath( appURL,
kCFURLPOSIXPathStyle );
CFIndex appLength = CFStringGetMaximumSizeForEncoding( CFStringGetLength(appRef),
CFStringGetFastestEncoding( appRef ));
const CFIndex appStringLength = CFStringGetMaximumSizeOfFileSystemRepresentation(appRef);
char * appString = tr_malloc( appLength + 1 );
bool success = CFStringGetCString( appRef,
appString,
appLength + 1,
CFStringGetFastestEncoding( appRef ));
char * appString = tr_malloc( appStringLength );
const bool success = CFStringGetFileSystemRepresentation( appRef, appString, appStringLength );
assert( success );
CFRelease( appURL );