If the user entered environment variables without a trailing newline we
might have been left with only one trailing NULL and therefore the
environment parameter would have been invalid. The path of least
resistance is to add two trailing NULLs unconditionally.
unsigned long i, j;\r
for (i = 0; i < envlen; i++) if (env[i] != '\r') newlen++;\r
/* Must end with two NULLs. */\r
- newlen++;\r
+ newlen += 2;\r
\r
char *newenv = (char *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, newlen);\r
if (! newenv) {\r