summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/fs/path_util.cpp4
-rw-r--r--src/common/input.h1
-rw-r--r--src/common/string_util.cpp4
-rw-r--r--src/common/string_util.h2
4 files changed, 8 insertions, 3 deletions
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp
index 62318e70c..1074f2421 100644
--- a/src/common/fs/path_util.cpp
+++ b/src/common/fs/path_util.cpp
@@ -232,9 +232,7 @@ void SetYuzuPath(YuzuPath yuzu_path, const fs::path& new_path) {
232fs::path GetExeDirectory() { 232fs::path GetExeDirectory() {
233 wchar_t exe_path[MAX_PATH]; 233 wchar_t exe_path[MAX_PATH];
234 234
235 GetModuleFileNameW(nullptr, exe_path, MAX_PATH); 235 if (GetModuleFileNameW(nullptr, exe_path, MAX_PATH) == 0) {
236
237 if (!exe_path) {
238 LOG_ERROR(Common_Filesystem, 236 LOG_ERROR(Common_Filesystem,
239 "Failed to get the path to the executable of the current process"); 237 "Failed to get the path to the executable of the current process");
240 } 238 }
diff --git a/src/common/input.h b/src/common/input.h
index 54fcb24b0..bb42aaacc 100644
--- a/src/common/input.h
+++ b/src/common/input.h
@@ -72,6 +72,7 @@ enum class PollingError {
72enum class VibrationAmplificationType { 72enum class VibrationAmplificationType {
73 Linear, 73 Linear,
74 Exponential, 74 Exponential,
75 Test,
75}; 76};
76 77
77// Analog properties for calibration 78// Analog properties for calibration
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp
index 703aa5db8..7a495bc79 100644
--- a/src/common/string_util.cpp
+++ b/src/common/string_util.cpp
@@ -178,6 +178,10 @@ std::wstring UTF8ToUTF16W(const std::string& input) {
178 178
179#endif 179#endif
180 180
181std::u16string U16StringFromBuffer(const u16* input, std::size_t length) {
182 return std::u16string(reinterpret_cast<const char16_t*>(input), length);
183}
184
181std::string StringFromFixedZeroTerminatedBuffer(std::string_view buffer, std::size_t max_len) { 185std::string StringFromFixedZeroTerminatedBuffer(std::string_view buffer, std::size_t max_len) {
182 std::size_t len = 0; 186 std::size_t len = 0;
183 while (len < buffer.length() && len < max_len && buffer[len] != '\0') { 187 while (len < buffer.length() && len < max_len && buffer[len] != '\0') {
diff --git a/src/common/string_util.h b/src/common/string_util.h
index a33830aec..ce18a33cf 100644
--- a/src/common/string_util.h
+++ b/src/common/string_util.h
@@ -44,6 +44,8 @@ bool SplitPath(const std::string& full_path, std::string* _pPath, std::string* _
44 44
45#endif 45#endif
46 46
47[[nodiscard]] std::u16string U16StringFromBuffer(const u16* input, std::size_t length);
48
47/** 49/**
48 * Compares the string defined by the range [`begin`, `end`) to the null-terminated C-string 50 * Compares the string defined by the range [`begin`, `end`) to the null-terminated C-string
49 * `other` for equality. 51 * `other` for equality.