summaryrefslogtreecommitdiffstats
path: root/plugins-root/check_icmp.c
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-02-19 14:39:08 +0100
committerRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-02-19 14:39:08 +0100
commit74b6984047d330a3cc7cb7f63645849fe7676c63 (patch)
tree65a26800103d8d66f7e6cb4acfbfc9f315ec750b /plugins-root/check_icmp.c
parent423284edfa980fc3fdb51ab20af96685a988ba97 (diff)
parentc07206f2ccc2356aa74bc6813a94c2190017d44e (diff)
downloadmonitoring-plugins-74b6984047d330a3cc7cb7f63645849fe7676c63.tar.gz
Merge branch 'master' into check_icmp_cleanup
Diffstat (limited to 'plugins-root/check_icmp.c')
-rw-r--r--plugins-root/check_icmp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c
index e59e92d3..c3be2efd 100644
--- a/plugins-root/check_icmp.c
+++ b/plugins-root/check_icmp.c
@@ -448,6 +448,14 @@ main(int argc, char **argv)
448 packets = 5; 448 packets = 5;
449 } 449 }
450 450
451 /* support "--help" and "--version" */
452 if(argc == 2) {
453 if(!strcmp(argv[1], "--help"))
454 strcpy(argv[1], "-h");
455 if(!strcmp(argv[1], "--version"))
456 strcpy(argv[1], "-V");
457 }
458
451 /* Parse protocol arguments first */ 459 /* Parse protocol arguments first */
452 for(i = 1; i < argc; i++) { 460 for(i = 1; i < argc; i++) {
453 while((arg = getopt(argc, argv, opts_str)) != EOF) { 461 while((arg = getopt(argc, argv, opts_str)) != EOF) {
@@ -552,14 +560,6 @@ main(int argc, char **argv)
552 /* Parse extra opts if any */ 560 /* Parse extra opts if any */
553 argv=np_extra_opts(&argc, argv, progname); 561 argv=np_extra_opts(&argc, argv, progname);
554 562
555 /* support "--help" and "--version" */
556 if(argc == 2) {
557 if(!strcmp(argv[1], "--help"))
558 strcpy(argv[1], "-h");
559 if(!strcmp(argv[1], "--version"))
560 strcpy(argv[1], "-V");
561 }
562
563 argv = &argv[optind]; 563 argv = &argv[optind];
564 while(*argv) { 564 while(*argv) {
565 add_target(*argv); 565 add_target(*argv);