mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-07-17 08:32:07 -05:00
Fix string sanitation logic error.
This commit is contained in:
parent
320569e98f
commit
073d8a5169
2
Makefile
2
Makefile
|
|
@ -39,7 +39,7 @@ INCLUDES := include ./Libraries/FsLib/Switch/FsLib/include ./Libraries/SDLLib/SD
|
|||
EXEFS_SRC := exefs_src
|
||||
APP_TITLE := JKSV
|
||||
APP_AUTHOR := JK
|
||||
APP_VERSION := 09.08.2025
|
||||
APP_VERSION := 09.13.2025
|
||||
ROMFS := romfs
|
||||
ICON := icon.jpg
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ namespace
|
|||
/// @brief Build month.
|
||||
constexpr uint8_t BUILD_MON = 9;
|
||||
/// @brief Build day.
|
||||
constexpr uint8_t BUILD_DAY = 8;
|
||||
constexpr uint8_t BUILD_DAY = 13;
|
||||
/// @brief Year.
|
||||
constexpr uint16_t BUILD_YEAR = 2025;
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,11 @@ bool stringutil::sanitize_string_for_path(const char *stringIn, char *stringOut,
|
|||
|
||||
const bool isForbidden = std::find(FORBIDDEN_PATH_CHARACTERS.begin(), FORBIDDEN_PATH_CHARACTERS.end(), codepoint) !=
|
||||
FORBIDDEN_PATH_CHARACTERS.end();
|
||||
if (isForbidden) { stringOut[outOffset++] = 0x20; }
|
||||
if (isForbidden)
|
||||
{
|
||||
i += count;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::memcpy(&stringOut[outOffset], &stringIn[i], static_cast<size_t>(count));
|
||||
|
|
@ -82,7 +86,7 @@ bool stringutil::sanitize_string_for_path(const char *stringIn, char *stringOut,
|
|||
}
|
||||
|
||||
const int outLength = std::char_traits<char>::length(stringOut) - 1;
|
||||
for (int i = outLength; i-- > 0 && (stringOut[i] == ' ' || stringOut[i] == '.');) { stringOut[i] = '\0'; }
|
||||
for (int i = outLength; i > 0 && (stringOut[i] == ' ' || stringOut[i] == '.'); i--) { stringOut[i] = '\0'; }
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user