1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-12-26 10:09:52 +03:00

Merge pull request #774 from chipitsine/master

Merge PR #774: vpntest: return non zero on invalid syntax
This commit is contained in:
Ilya Shipitsin 2018-10-27 10:16:13 +05:00 committed by GitHub
commit ae34141b7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,11 +101,12 @@ TEST_LIST test_list[] =
};
// Test function
void TestMain(char *cmd)
int TestMain(char *cmd)
{
char tmp[MAX_SIZE];
bool first = true;
bool exit_now = false;
int status = 0;
Print("SoftEther VPN Project\n");
Print("vpntest: VPN Server / VPN Client / VPN Bridge test program\n");
@ -204,6 +205,7 @@ void TestMain(char *cmd)
}
if (b == false)
{
status = 2;
Print("Invalid Command: %s\n\n", cmd);
}
}
@ -216,6 +218,7 @@ void TestMain(char *cmd)
}
}
Print("Exiting...\n\n");
return status;
}
// Main function
@ -225,6 +228,7 @@ int main(int argc, char *argv[])
UINT i;
char cmd[MAX_SIZE];
char *s;
int status = 0;
InitProcessCallOnce();
@ -252,10 +256,10 @@ int main(int argc, char *argv[])
EnableProbe(true);
InitCedar();
SetHamMode();
TestMain(cmdline);
status = TestMain(cmdline);
FreeCedar();
FreeMayaqua();
return 0;
return status;
}