diff options
author | Jacob Hansen <jhansen@op5.com> | 2018-12-10 13:43:09 +0000 |
---|---|---|
committer | Jacob Hansen <jhansen@op5.com> | 2018-12-10 14:39:13 +0000 |
commit | 7a660b3f018e0903e098cbd2e766a9af18f6723f (patch) | |
tree | 5f20366050cb357c249127c081252288df3ba58a /plugins-root/check_icmp.c | |
parent | 0882b4201bfa0608b90448c4866b571a20e1fd66 (diff) | |
download | monitoring-plugins-7a660b3f018e0903e098cbd2e766a9af18f6723f.tar.gz |
check_icmp: move opts string into a variable
This commit moves the opts string into a variable as it is now used
twice.
Signed-off-by: Jacob Hansen <jhansen@op5.com>
Diffstat (limited to 'plugins-root/check_icmp.c')
-rw-r--r-- | plugins-root/check_icmp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 1a2a1772..6a883a82 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -410,6 +410,7 @@ main(int argc, char **argv) #ifdef SO_TIMESTAMP int on = 1; #endif + char * opts_str = "vhVw:c:n:p:t:H:s:i:b:I:l:m:64"; setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); @@ -462,7 +463,7 @@ main(int argc, char **argv) /* Parse protocol arguments first */ for(i = 1; i < argc; i++) { - while((arg = getopt(argc, argv, "vhVw:c:n:p:t:H:s:i:b:I:l:m:64")) != EOF) { + while((arg = getopt(argc, argv, opts_str)) != EOF) { unsigned short size; switch(arg) { case '4': @@ -484,7 +485,7 @@ main(int argc, char **argv) /* parse the arguments */ for(i = 1; i < argc; i++) { - while((arg = getopt(argc, argv, "vhVw:c:n:p:t:H:s:i:b:I:l:m:64")) != EOF) { + while((arg = getopt(argc, argv, opts_str)) != EOF) { unsigned short size; switch(arg) { case 'v': |