summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2021-10-13 18:49:22 +0200
committerMorph <39850852+Morph1984@users.noreply.github.com>2021-10-14 20:09:34 +0200
commit3ffff78a27bb6db97224bbd831b6aafb39fb51bd (patch)
treecdac4815379a25504b5ec62a522dbe8e8c30ff98
parentMerge pull request #7120 from Morph1984/update-dynarmic (diff)
downloadyuzu-3ffff78a27bb6db97224bbd831b6aafb39fb51bd.tar
yuzu-3ffff78a27bb6db97224bbd831b6aafb39fb51bd.tar.gz
yuzu-3ffff78a27bb6db97224bbd831b6aafb39fb51bd.tar.bz2
yuzu-3ffff78a27bb6db97224bbd831b6aafb39fb51bd.tar.lz
yuzu-3ffff78a27bb6db97224bbd831b6aafb39fb51bd.tar.xz
yuzu-3ffff78a27bb6db97224bbd831b6aafb39fb51bd.tar.zst
yuzu-3ffff78a27bb6db97224bbd831b6aafb39fb51bd.zip
-rw-r--r--src/common/string_util.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp
index e6344fd41..9617c3fa3 100644
--- a/src/common/string_util.cpp
+++ b/src/common/string_util.cpp
@@ -191,9 +191,9 @@ std::string StringFromFixedZeroTerminatedBuffer(const char* buffer, std::size_t
std::u16string UTF16StringFromFixedZeroTerminatedBuffer(std::u16string_view buffer,
std::size_t max_len) {
std::size_t len = 0;
- while (len < max_len && buffer[len] != '\0')
+ while (len < buffer.length() && len < max_len && buffer[len] != '\0') {
++len;
-
+ }
return std::u16string(buffer.begin(), buffer.begin() + len);
}