summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-11-11 22:39:25 +0100
committerZach Hilman <zachhilman@gmail.com>2018-11-18 16:53:47 +0100
commite696ed1f4d20f28f8b26c637498962938df7d96f (patch)
tree79222d795725ba7b19f0aa9326041e236f9a22d8 /src/common
parentqt/main: Register Qt Software Keyboard frontend with AM (diff)
downloadyuzu-e696ed1f4d20f28f8b26c637498962938df7d96f.tar
yuzu-e696ed1f4d20f28f8b26c637498962938df7d96f.tar.gz
yuzu-e696ed1f4d20f28f8b26c637498962938df7d96f.tar.bz2
yuzu-e696ed1f4d20f28f8b26c637498962938df7d96f.tar.lz
yuzu-e696ed1f4d20f28f8b26c637498962938df7d96f.tar.xz
yuzu-e696ed1f4d20f28f8b26c637498962938df7d96f.tar.zst
yuzu-e696ed1f4d20f28f8b26c637498962938df7d96f.zip
Diffstat (limited to 'src/common')
-rw-r--r--src/common/string_util.cpp4
-rw-r--r--src/common/string_util.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp
index a1360dd26..959f278aa 100644
--- a/src/common/string_util.cpp
+++ b/src/common/string_util.cpp
@@ -214,13 +214,13 @@ std::string StringFromFixedZeroTerminatedBuffer(const char* buffer, std::size_t
return std::string(buffer, len);
}
-std::u16string UTF16StringFromFixedZeroTerminatedBuffer(const char16_t* buffer,
+std::u16string UTF16StringFromFixedZeroTerminatedBuffer(std::u16string_view buffer,
std::size_t max_len) {
std::size_t len = 0;
while (len < max_len && buffer[len] != '\0')
++len;
- return std::u16string(buffer, len);
+ return std::u16string(buffer.begin(), buffer.begin() + len);
}
const char* TrimSourcePath(const char* path, const char* root) {
diff --git a/src/common/string_util.h b/src/common/string_util.h
index 95b7badaf..583fd05e6 100644
--- a/src/common/string_util.h
+++ b/src/common/string_util.h
@@ -68,10 +68,10 @@ std::string StringFromFixedZeroTerminatedBuffer(const char* buffer, std::size_t
/**
* Creates a UTF-16 std::u16string from a fixed-size NUL-terminated char buffer. If the buffer isn't
- * NUL-terminated, then the string ends at the greatest multiple of two less then or equal to
+ * null-terminated, then the string ends at the greatest multiple of two less then or equal to
* max_len_bytes.
*/
-std::u16string UTF16StringFromFixedZeroTerminatedBuffer(const char16_t* buffer,
+std::u16string UTF16StringFromFixedZeroTerminatedBuffer(std::u16string_view buffer,
std::size_t max_len);
/**