Merge pull request #690 from Self-Hosting-Group/upnpc_fix_and_complete_check_of_the_number_of_options_required

upnpc: Fix and complete check of the number of options required
This commit is contained in:
Thomas BERNARD 2024-01-26 01:41:25 +01:00 committed by GitHub
commit c42892f387
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 3 deletions

View File

@ -652,11 +652,16 @@ int main(int argc, char ** argv)
if(!command
|| (command == 'a' && commandargc<4)
|| (command == 'd' && argc<2)
|| (command == 'r' && argc<2)
|| (command == 'r' && commandargc<2)
|| (command == 'A' && commandargc<6)
|| (command == 'd' && commandargc<2)
|| (command == 'D' && commandargc<1)
|| (command == 'n' && commandargc<4)
|| (command == 'N' && commandargc<3)
|| (command == 'U' && commandargc<2)
|| (command == 'D' && commandargc<1))
|| (command == 'K' && commandargc<1)
|| (command == 'C' && commandargc<1)
|| (command == 'G' && commandargc<5))
{
fprintf(stderr, "Usage:\n");
fprintf(stderr, " %s [options] -a ip port external_port protocol [duration] [remote host]\n Add port mapping\n", argv[0]);