diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2022-07-26 12:52:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-26 12:52:50 +0200 |
| commit | 6b419c7ca3e3ed5fcb208f87fa352d5860c28adc (patch) | |
| tree | d9e91e6c5891847d07d40b583f6504e06971a91e /Source/Core/Common/StringUtil.cpp | |
| parent | 9d15a1c5a1e6183a0e98165ac093e74ca8e4894e (diff) | |
| parent | 76b4318b88cb952750da158809e68274adbd9493 (diff) | |
Merge pull request #10876 from shuffle2/cpudetect
CPUDetect: improve win/arm64 support
Diffstat (limited to 'Source/Core/Common/StringUtil.cpp')
| -rw-r--r-- | Source/Core/Common/StringUtil.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp index 4a5f21ddc2..849e83815c 100644 --- a/Source/Core/Common/StringUtil.cpp +++ b/Source/Core/Common/StringUtil.cpp @@ -259,6 +259,13 @@ void ReplaceBreaksWithSpaces(std::string& str) std::replace(str.begin(), str.end(), '\n', ' '); } +void TruncateToCString(std::string* s) +{ + const size_t terminator = s->find_first_of('\0'); + if (terminator != s->npos) + s->resize(terminator); +} + bool TryParse(const std::string& str, bool* const output) { float value; |
