Skip to content

VERY experimental Nintendo Switch 2 emulator

C++

startup_checks: Resolve -Wstringop-truncation

Morph72d7f4f4ff33
diff --git a/src/yuzu/startup_checks.cpp b/src/yuzu/startup_checks.cpp
index 9bb2a6ef4b..6a91212e20 100644
--- a/src/yuzu/startup_checks.cpp
+++ b/src/yuzu/startup_checks.cpp
@@ -135,7 +135,8 @@ bool SpawnChild(const char* arg0, PROCESS_INFORMATION* pi, int flags) {
startup_info.cb = sizeof(startup_info);
char p_name[255];
- std::strncpy(p_name, arg0, 255);
+ std::strncpy(p_name, arg0, 254);
+ p_name[254] = '\0';
const bool process_created = CreateProcessA(nullptr, // lpApplicationName
p_name, // lpCommandLine