[NET] Fix some 'net help' and 'net user' issues.
authorEric Kohl <eric.kohl@reactos.org>
Sat, 9 Mar 2019 23:30:27 +0000 (00:30 +0100)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 9 Mar 2019 23:30:27 +0000 (00:30 +0100)
base/applications/network/net/cmdHelp.c
base/applications/network/net/cmdUser.c
base/applications/network/net/main.c

index 716009e..b1643a2 100644 (file)
@@ -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);
index 238baaa..0cb5dac 100644 (file)
@@ -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);
index 579ea4c..773c25f 100644 (file)
@@ -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);