use strerror() to generate error message

as suggested by @terrelln .

also:
- hopefully fixed Windows version
- changed the test, so that it passes on non-english OS stdlib errors.
This commit is contained in:
Yann Collet committed 2018-12-20 09:16:40 -08:00
1 parent de4eb06a77
commit 105fa953cb
3 files changed
+23 -18

No files matched your search

+6 -2
View File
@@ -24,8 +24,12 @@ extern "C" {
int UTIL_fileExist(const char* filename)
{
stat_t statbuf;
int const stat_success = stat(filename, &statbuf);
return !stat_success;
#if defined(_MSC_VER)
int const stat_error = _stat64(filename, &statbuf);
#else
int const stat_error = stat(filename, &statbuf);
#endif
return !stat_error;
}
int UTIL_isRegularFile(const char* infilename)