From 718845a33d09fc8f00e3353b75e786f3c10915e2 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 15 Sep 2024 09:21:04 -0700
Subject: [PATCH] Fixed warning C4701: potentially uninitialized local variable
'startup_info' used
---
src/process/windows/SDL_windowsprocess.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/process/windows/SDL_windowsprocess.c b/src/process/windows/SDL_windowsprocess.c
index 945edf716588c..dae6c8186bc82 100644
--- a/src/process/windows/SDL_windowsprocess.c
+++ b/src/process/windows/SDL_windowsprocess.c
@@ -216,14 +216,6 @@ bool SDL_SYS_CreateProcessWithProperties(SDL_Process *process, SDL_PropertiesID
}
process->internal = data;
- if (!join_arguments(args, &createprocess_cmdline)) {
- goto done;
- }
-
- if (!join_env(envp, &createprocess_env)) {
- goto done;
- }
-
creation_flags = CREATE_UNICODE_ENVIRONMENT;
SDL_zero(startup_info);
@@ -238,6 +230,14 @@ bool SDL_SYS_CreateProcessWithProperties(SDL_Process *process, SDL_PropertiesID
security_attributes.bInheritHandle = TRUE;
security_attributes.lpSecurityDescriptor = NULL;
+ if (!join_arguments(args, &createprocess_cmdline)) {
+ goto done;
+ }
+
+ if (!join_env(envp, &createprocess_env)) {
+ goto done;
+ }
+
// Background processes don't have access to the terminal
// This isn't necessary on Windows, but we keep the same behavior as the POSIX implementation.
if (process->background) {