1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-22 17:39:53 +03:00

vpntest: return non zero on invalid syntax

This commit is contained in:
Ilya Shipitsin 2018-10-27 09:55:42 +05:00
parent 9ae379bc31
commit 292670cfa2

View File

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