summaryrefslogtreecommitdiffstats
path: root/plugins/check_smtp.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_smtp.c')
-rw-r--r--plugins/check_smtp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index fd492294..44b735f9 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -517,6 +517,7 @@ check_smtp_config_wrapper process_arguments(int argc, char **argv) {
517 int command_size = 0; 517 int command_size = 0;
518 int response_size = 0; 518 int response_size = 0;
519 bool implicit_tls = false; 519 bool implicit_tls = false;
520 int server_port_option = 0;
520 while (true) { 521 while (true) {
521 int opt_index = getopt_long(argc, argv, "+hVv46Lrt:p:f:e:c:w:H:C:R:sSD:F:A:U:P:q", longopts, &option); 522 int opt_index = getopt_long(argc, argv, "+hVv46Lrt:p:f:e:c:w:H:C:R:sSD:F:A:U:P:q", longopts, &option);
522 523
@@ -534,7 +535,7 @@ check_smtp_config_wrapper process_arguments(int argc, char **argv) {
534 break; 535 break;
535 case 'p': /* port */ 536 case 'p': /* port */
536 if (is_intpos(optarg)) { 537 if (is_intpos(optarg)) {
537 result.config.server_port = atoi(optarg); 538 server_port_option = atoi(optarg);
538 } else { 539 } else {
539 usage4(_("Port must be a positive integer")); 540 usage4(_("Port must be a positive integer"));
540 } 541 }
@@ -710,6 +711,10 @@ check_smtp_config_wrapper process_arguments(int argc, char **argv) {
710 } 711 }
711 } 712 }
712 713
714 if (server_port_option != 0) {
715 result.config.server_port = server_port_option;
716 }
717
713 return result; 718 return result;
714} 719}
715 720