diff --git a/Source/Engine/Platform/Android/AndroidFileSystem.cpp b/Source/Engine/Platform/Android/AndroidFileSystem.cpp index 09ee35a0f..78fa8953d 100644 --- a/Source/Engine/Platform/Android/AndroidFileSystem.cpp +++ b/Source/Engine/Platform/Android/AndroidFileSystem.cpp @@ -249,13 +249,13 @@ bool AndroidFileSystem::DeleteFile(const StringView& path) uint64 AndroidFileSystem::GetFileSize(const StringView& path) { struct stat fileInfo; - fileInfo.st_size = -1; + fileInfo.st_size = 0; const StringAsANSI<> pathANSI(*path, path.Length()); if (stat(pathANSI.Get(), &fileInfo) != -1) { if (S_ISDIR(fileInfo.st_mode)) { - fileInfo.st_size = -1; + fileInfo.st_size = 0; } } else diff --git a/Source/Engine/Platform/Apple/AppleFileSystem.cpp b/Source/Engine/Platform/Apple/AppleFileSystem.cpp index e1b19ef56..cc18fc3ed 100644 --- a/Source/Engine/Platform/Apple/AppleFileSystem.cpp +++ b/Source/Engine/Platform/Apple/AppleFileSystem.cpp @@ -223,14 +223,14 @@ bool AppleFileSystem::DeleteFile(const StringView& path) uint64 AppleFileSystem::GetFileSize(const StringView& path) { struct stat fileInfo; - fileInfo.st_size = -1; + fileInfo.st_size = 0; const StringAsANSI<> pathANSI(*path, path.Length()); if (stat(pathANSI.Get(), &fileInfo) != -1) { // Check for directories if (S_ISDIR(fileInfo.st_mode)) { - fileInfo.st_size = -1; + fileInfo.st_size = 0; } } return fileInfo.st_size; diff --git a/Source/Engine/Platform/Linux/LinuxFileSystem.cpp b/Source/Engine/Platform/Linux/LinuxFileSystem.cpp index e713f5777..f0d5ff499 100644 --- a/Source/Engine/Platform/Linux/LinuxFileSystem.cpp +++ b/Source/Engine/Platform/Linux/LinuxFileSystem.cpp @@ -346,14 +346,14 @@ bool LinuxFileSystem::DeleteFile(const StringView& path) uint64 LinuxFileSystem::GetFileSize(const StringView& path) { struct stat fileInfo; - fileInfo.st_size = -1; + fileInfo.st_size = 0; const StringAsANSI<> pathANSI(*path, path.Length()); if (stat(pathANSI.Get(), &fileInfo) != -1) { // Check for directories if (S_ISDIR(fileInfo.st_mode)) { - fileInfo.st_size = -1; + fileInfo.st_size = 0; } } return fileInfo.st_size;