X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0a434b1015342838eb38e95a5040cc50ce03911a..87f0b1323b7ac77f02133b836c8dfee63b0fd387:/src/common/filefn.cpp diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index a05b15e438..92ce4c1f64 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -1355,9 +1355,7 @@ wxString wxFindNextFile() wxCHECK_MSG( gs_dir, "", "You must call wxFindFirstFile before!" ); wxString result; - gs_dir->GetNext(&result); - - if ( result.empty() ) + if ( !gs_dir->GetNext(&result) || result.empty() ) { wxDELETE(gs_dir); return result; @@ -1574,8 +1572,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);