diff --git a/reactos/subsys/system/cmd/cmd.c b/reactos/subsys/system/cmd/cmd.c index 1c6966f96ab..9927f1cd3cd 100644 --- a/reactos/subsys/system/cmd/cmd.c +++ b/reactos/subsys/system/cmd/cmd.c @@ -1552,7 +1552,7 @@ Initialize (int argc, TCHAR* argv[]) for you can change the EnvirommentVariable for prompt before cmd start this patch are not 100% right, if it does not exists a PROMPT value cmd should use $P$G as defualt not set EnvirommentVariable PROMPT to $P$G if it does not exists */ - if (GetEnvironmentVariable(_T("PROMPT"),lpBuffer, 2 * sizeof(TCHAR)) == 0) + if (GetEnvironmentVariable(_T("PROMPT"),lpBuffer, sizeof(lpBuffer) / sizeof(lpBuffer[0])) == 0) SetEnvironmentVariable (_T("PROMPT"), _T("$P$G")); diff --git a/reactos/subsys/system/cmd/if.c b/reactos/subsys/system/cmd/if.c index ad4163954b9..b040d1c098d 100644 --- a/reactos/subsys/system/cmd/if.c +++ b/reactos/subsys/system/cmd/if.c @@ -131,7 +131,7 @@ INT cmd_if (LPTSTR cmd, LPTSTR param) if (*pp) { *pp++ = _T('\0'); - ValueSize = GetEnvironmentVariable(param, Value, sizeof Value); + ValueSize = GetEnvironmentVariable(param, Value, sizeof(Value) / sizeof(Value[0])); x_flag ^= (0 == ValueSize) ? 0 : X_EXEC; diff --git a/reactos/subsys/system/cmd/where.c b/reactos/subsys/system/cmd/where.c index 555734012c0..3136f46e842 100644 --- a/reactos/subsys/system/cmd/where.c +++ b/reactos/subsys/system/cmd/where.c @@ -157,7 +157,7 @@ SearchForExecutableSingle (LPCTSTR pFileName, LPTSTR pFullName, LPTSTR pExtensio if (dwBuffer > ENV_BUFFER_SIZE) { pszBuffer = (LPTSTR)realloc (pszBuffer, dwBuffer * sizeof (TCHAR)); - GetEnvironmentVariable (_T("PATH"), pszBuffer, dwBuffer * sizeof (TCHAR)); + GetEnvironmentVariable (_T("PATH"), pszBuffer, dwBuffer); } @@ -222,7 +222,7 @@ SearchForExecutable (LPCTSTR pFileName, LPTSTR pFullName) if (dwBuffer > ENV_BUFFER_SIZE) { pszBuffer = (LPTSTR)realloc (pszBuffer, dwBuffer * sizeof (TCHAR)); - GetEnvironmentVariable (_T("PATHEXT"), pszBuffer, dwBuffer * sizeof (TCHAR)); + GetEnvironmentVariable (_T("PATHEXT"), pszBuffer, dwBuffer); } else if (0 == dwBuffer) {