From 997e5aac3eb40ad17784c10195ed9a951efc6ab5 Mon Sep 17 00:00:00 2001 From: Nitraiolo Date: Sat, 17 Dec 2022 21:49:04 +0100 Subject: [PATCH] Fix py_args[] population --- client/src/cmdscript.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/src/cmdscript.c b/client/src/cmdscript.c index 16d933d76..b8065950e 100644 --- a/client/src/cmdscript.c +++ b/client/src/cmdscript.c @@ -431,9 +431,8 @@ static int CmdScriptRun(const char *Cmd) { PyConfig_Clear(&py_conf); #else wchar_t *py_args[argc + 1]; - py_args[0] = Py_DecodeLocale(filename, NULL); - for (int i = 0; i < argc; i++) { - py_args[i + 1] = Py_DecodeLocale(argv[i], NULL); + for (int i = 0; i <= argc; i++) { + py_args[i] = Py_DecodeLocale(argv[i], NULL); } PySys_SetArgv(argc + 1, py_args);