mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
startup_checks: Resolve -Wstringop-truncation
Copies up to sizeof(p_name) - 1 in strncpy and null terminates it at p_name[254]
This commit is contained in:
parent
f86774c1ac
commit
bb31b0f261
1 changed files with 2 additions and 1 deletions
|
@ -135,7 +135,8 @@ bool SpawnChild(const char* arg0, PROCESS_INFORMATION* pi, int flags) {
|
||||||
startup_info.cb = sizeof(startup_info);
|
startup_info.cb = sizeof(startup_info);
|
||||||
|
|
||||||
char p_name[255];
|
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
|
const bool process_created = CreateProcessA(nullptr, // lpApplicationName
|
||||||
p_name, // lpCommandLine
|
p_name, // lpCommandLine
|
||||||
|
|
Loading…
Reference in a new issue