X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/983aac2cdc670db63fe7c496e326e05d70a321dc..64ea838d8f4d1853b7d850db93ee565e901d099a:/src/common/filefn.cpp diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index b1d98afaf8..2e04e80098 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -842,6 +842,9 @@ wxString wxMacFSRefToPath( const FSRef *fsRef , CFStringRef additionalPathCompon { CFURLRef fullURLRef; fullURLRef = CFURLCreateFromFSRef(NULL, fsRef); + if ( fullURLRef == NULL) + return wxEmptyString; + if ( additionalPathComponent ) { CFURLRef parentURLRef = fullURLRef ; @@ -1571,8 +1574,12 @@ wxString wxGetOSDirectory() #ifdef __WXWINCE__ return wxString(wxT("\\Windows")); #elif defined(__WINDOWS__) && !defined(__WXMICROWIN__) - wxChar buf[256]; - GetWindowsDirectory(buf, 256); + wxChar buf[MAX_PATH]; + if ( !GetWindowsDirectory(buf, MAX_PATH) ) + { + wxLogLastError(wxS("GetWindowsDirectory")); + } + return wxString(buf); #elif defined(__WXMAC__) && wxOSX_USE_CARBON return wxMacFindFolderNoSeparator(kOnSystemDisk, 'macs', false);