Skip to content
Snippets Groups Projects
Commit bb31b0f2 authored by Morph's avatar Morph
Browse files

startup_checks: Resolve -Wstringop-truncation

Copies up to sizeof(p_name) - 1 in strncpy and null terminates it at p_name[254]
parent f86774c1
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment