[NET] Fix some 'net help' and 'net user' issues.

This commit is contained in:
Eric Kohl 2019-03-10 00:30:27 +01:00
parent 462418fe38
commit 4d8859cfd8
3 changed files with 8 additions and 5 deletions

View file

@ -13,13 +13,13 @@ INT cmdHelp(INT argc, WCHAR **argv)
{ {
ConResPuts(StdOut, IDS_GENERIC_SYNTAX); ConResPuts(StdOut, IDS_GENERIC_SYNTAX);
/*
if (argc != 3) if (argc != 3)
{ {
ConResPuts(StdOut, IDS_HELP_SYNTAX); PrintNetMessage(MSG_HELP_SYNTAX);
PrintNetMessage(MSG_HELP_HELP);
return 0; return 0;
} }
*/
if (_wcsicmp(argv[2], L"ACCOUNTS") == 0) if (_wcsicmp(argv[2], L"ACCOUNTS") == 0)
{ {
PrintNetMessage(MSG_ACCOUNTS_SYNTAX); PrintNetMessage(MSG_ACCOUNTS_SYNTAX);

View file

@ -637,14 +637,14 @@ cmdUser(
NET_API_STATUS Status; NET_API_STATUS Status;
i = 2; i = 2;
if (argv[i][0] != L'/') if ((i < argc) && (argv[i][0] != L'/'))
{ {
lpUserName = argv[i]; lpUserName = argv[i];
// ConPrintf(StdOut, L"User: %s\n", lpUserName); // ConPrintf(StdOut, L"User: %s\n", lpUserName);
i++; i++;
} }
if (argv[i][0] != L'/') if ((i < argc) && (argv[i][0] != L'/'))
{ {
lpPassword = argv[i]; lpPassword = argv[i];
// ConPrintf(StdOut, L"Password: %s\n", lpPassword); // ConPrintf(StdOut, L"Password: %s\n", lpPassword);

View file

@ -246,7 +246,10 @@ int wmain(int argc, WCHAR **argv)
done: done:
if (bRun == FALSE) if (bRun == FALSE)
{
ConResPuts(StdOut, IDS_GENERIC_SYNTAX);
PrintNetMessage(MSG_NET_SYNTAX); PrintNetMessage(MSG_NET_SYNTAX);
}
if (hModuleNetMsg != NULL) if (hModuleNetMsg != NULL)
FreeLibrary(hModuleNetMsg); FreeLibrary(hModuleNetMsg);