From fca4a2ec28132da2869cd87dc1c9782d275fed55 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 10 Nov 2021 13:18:30 +1000 Subject: [PATCH] Common/FileSystem: Fix a couple of warnings from #2716 --- src/common/file_system.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/file_system.cpp b/src/common/file_system.cpp index 6e8464004..4cf26011a 100644 --- a/src/common/file_system.cpp +++ b/src/common/file_system.cpp @@ -451,7 +451,7 @@ void CanonicalizePath(char* Destination, u32 cbDestination, const char* Path, bo { char prevCh = (i > 0) ? Path[i - 1] : '\0'; char currentCh = Path[i]; - char nextCh = (i < pathLength) ? Path[i + 1] : '\0'; + char nextCh = (i < (pathLength - 1)) ? Path[i + 1] : '\0'; if (currentCh == '.') { @@ -557,8 +557,8 @@ void CanonicalizePath(std::string& path, bool OSPath /*= true*/) static inline bool FileSystemCharacterIsSane(char c, bool StripSlashes) { - if (!(c >= 'a' && c <= 'z') && !(c >= 'A' && c <= 'Z') && !(c >= '0' && c <= '9') && c != ' ' && c != ' ' && - c != '_' && c != '-' && c != '.') + if (!(c >= 'a' && c <= 'z') && !(c >= 'A' && c <= 'Z') && !(c >= '0' && c <= '9') && c != ' ' && c != '_' && + c != '-' && c != '.') { if (!StripSlashes && (c == '/' || c == '\\')) return true;