https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4d8859cfd897f22a2fe30…
commit 4d8859cfd897f22a2fe301f2760a2f27084c3594
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sun Mar 10 00:30:27 2019 +0100
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Sun Mar 10 00:30:27 2019 +0100
[NET] Fix some 'net help' and 'net user' issues.
---
base/applications/network/net/cmdHelp.c | 6 +++---
base/applications/network/net/cmdUser.c | 4 ++--
base/applications/network/net/main.c | 3 +++
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/base/applications/network/net/cmdHelp.c
b/base/applications/network/net/cmdHelp.c
index 716009ed59..b1643a2c4f 100644
--- a/base/applications/network/net/cmdHelp.c
+++ b/base/applications/network/net/cmdHelp.c
@@ -13,13 +13,13 @@ INT cmdHelp(INT argc, WCHAR **argv)
{
ConResPuts(StdOut, IDS_GENERIC_SYNTAX);
-/*
if (argc != 3)
{
- ConResPuts(StdOut, IDS_HELP_SYNTAX);
+ PrintNetMessage(MSG_HELP_SYNTAX);
+ PrintNetMessage(MSG_HELP_HELP);
return 0;
}
-*/
+
if (_wcsicmp(argv[2], L"ACCOUNTS") == 0)
{
PrintNetMessage(MSG_ACCOUNTS_SYNTAX);
diff --git a/base/applications/network/net/cmdUser.c
b/base/applications/network/net/cmdUser.c
index 238baaa3cf..0cb5dacc8f 100644
--- a/base/applications/network/net/cmdUser.c
+++ b/base/applications/network/net/cmdUser.c
@@ -637,14 +637,14 @@ cmdUser(
NET_API_STATUS Status;
i = 2;
- if (argv[i][0] != L'/')
+ if ((i < argc) && (argv[i][0] != L'/'))
{
lpUserName = argv[i];
// ConPrintf(StdOut, L"User: %s\n", lpUserName);
i++;
}
- if (argv[i][0] != L'/')
+ if ((i < argc) && (argv[i][0] != L'/'))
{
lpPassword = argv[i];
// ConPrintf(StdOut, L"Password: %s\n", lpPassword);
diff --git a/base/applications/network/net/main.c b/base/applications/network/net/main.c
index 579ea4c10c..773c25fd94 100644
--- a/base/applications/network/net/main.c
+++ b/base/applications/network/net/main.c
@@ -246,7 +246,10 @@ int wmain(int argc, WCHAR **argv)
done:
if (bRun == FALSE)
+ {
+ ConResPuts(StdOut, IDS_GENERIC_SYNTAX);
PrintNetMessage(MSG_NET_SYNTAX);
+ }
if (hModuleNetMsg != NULL)
FreeLibrary(hModuleNetMsg);