MACOSX: Improve conversion of path from NSString to C string

Use `-[NSString fileSystemRepresentation]` if you are going to pass
a path to a lower-level function, like `fopen()`.
This commit is contained in:
C.W. Betts 2022-02-05 01:45:27 -07:00 committed by Thierry Crozat
parent 2f753222fe
commit b9d234e986

View File

@ -108,5 +108,5 @@ Common::String getDesktopPathMacOSX() {
NSString *path = [paths objectAtIndex:0];
if (path == nil)
return Common::String();
return Common::String([path cStringUsingEncoding:NSASCIIStringEncoding]);
return Common::String([path fileSystemRepresentation]);
}