summaryrefslogtreecommitdiffstats
path: root/Modules/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/main.c')
-rw-r--r--Modules/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/main.c b/Modules/main.c
index 9cbb3f1..286ad41 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -761,7 +761,7 @@ pymain_parse_cmdline_impl(_PyMain *pymain, _Py_CommandLineDetails *cmdline)
pymain->err = _Py_INIT_NO_MEMORY();
return -1;
}
- memcpy(command, _PyOS_optarg, len * sizeof(wchar_t));
+ memcpy(command, _PyOS_optarg, (len - 2) * sizeof(wchar_t));
command[len - 2] = '\n';
command[len - 1] = 0;
pymain->command = command;