diff options
Diffstat (limited to 'lib/extra_opts.c')
-rw-r--r-- | lib/extra_opts.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/lib/extra_opts.c b/lib/extra_opts.c index f4d5e66..771621d 100644 --- a/lib/extra_opts.c +++ b/lib/extra_opts.c | |||
@@ -1,23 +1,23 @@ | |||
1 | /***************************************************************************** | 1 | /***************************************************************************** |
2 | * | 2 | * |
3 | * Monitoring Plugins extra_opts library | 3 | * Monitoring Plugins extra_opts library |
4 | * | 4 | * |
5 | * License: GPL | 5 | * License: GPL |
6 | * Copyright (c) 2007 Monitoring Plugins Development Team | 6 | * Copyright (c) 2007 Monitoring Plugins Development Team |
7 | * | 7 | * |
8 | * This program is free software: you can redistribute it and/or modify | 8 | * This program is free software: you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation, either version 3 of the License, or | 10 | * the Free Software Foundation, either version 3 of the License, or |
11 | * (at your option) any later version. | 11 | * (at your option) any later version. |
12 | * | 12 | * |
13 | * This program is distributed in the hope that it will be useful, | 13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. |
17 | * | 17 | * |
18 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License |
19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 | * | 20 | * |
21 | *****************************************************************************/ | 21 | *****************************************************************************/ |
22 | 22 | ||
23 | #include "common.h" | 23 | #include "common.h" |
@@ -26,15 +26,14 @@ | |||
26 | #include "extra_opts.h" | 26 | #include "extra_opts.h" |
27 | 27 | ||
28 | /* FIXME: copied from utils.h; we should move a bunch of libs! */ | 28 | /* FIXME: copied from utils.h; we should move a bunch of libs! */ |
29 | int | 29 | bool is_option2 (char *str) |
30 | is_option2 (char *str) | ||
31 | { | 30 | { |
32 | if (!str) | 31 | if (!str) |
33 | return FALSE; | 32 | return false; |
34 | else if (strspn (str, "-") == 1 || strspn (str, "-") == 2) | 33 | else if (strspn (str, "-") == 1 || strspn (str, "-") == 2) |
35 | return TRUE; | 34 | return true; |
36 | else | 35 | else |
37 | return FALSE; | 36 | return false; |
38 | } | 37 | } |
39 | 38 | ||
40 | /* this is the externally visible function used by plugins */ | 39 | /* this is the externally visible function used by plugins */ |
@@ -93,14 +92,14 @@ char **np_extra_opts(int *argc, char **argv, const char *plugin_name){ | |||
93 | /* append the list to extra_args */ | 92 | /* append the list to extra_args */ |
94 | if(extra_args==NULL){ | 93 | if(extra_args==NULL){ |
95 | extra_args=ea1; | 94 | extra_args=ea1; |
96 | while(ea1=ea1->next) ea_num++; | 95 | while((ea1 = ea1->next)) ea_num++; |
97 | }else{ | 96 | }else{ |
98 | ea_tmp=extra_args; | 97 | ea_tmp=extra_args; |
99 | while(ea_tmp->next) { | 98 | while(ea_tmp->next) { |
100 | ea_tmp=ea_tmp->next; | 99 | ea_tmp=ea_tmp->next; |
101 | } | 100 | } |
102 | ea_tmp->next=ea1; | 101 | ea_tmp->next=ea1; |
103 | while(ea1=ea1->next) ea_num++; | 102 | while((ea1 = ea1->next)) ea_num++; |
104 | } | 103 | } |
105 | ea1=ea_tmp=NULL; | 104 | ea1=ea_tmp=NULL; |
106 | } | 105 | } |