diff options
author | Jan Wagner <waja@cyconet.org> | 2023-10-17 11:39:37 (GMT) |
---|---|---|
committer | Jan Wagner <waja@cyconet.org> | 2023-10-17 11:39:37 (GMT) |
commit | 2a047014385022c8dc06dad4da0428db14898689 (patch) | |
tree | 00abea46325decf0c72870ee8f9ec1472e8e5344 /lib/parse_ini.c | |
parent | f39211c26408af582121f519d89c8abf70e6d437 (diff) | |
parent | e23a75d954311b3be429a9020e4d317b89615ee7 (diff) | |
download | monitoring-plugins-2a047014385022c8dc06dad4da0428db14898689.tar.gz |
Merge branch 'master' of github.com:monitoring-plugins/monitoring-plugins
Diffstat (limited to 'lib/parse_ini.c')
-rw-r--r-- | lib/parse_ini.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/parse_ini.c b/lib/parse_ini.c index 547af43..0cc864a 100644 --- a/lib/parse_ini.c +++ b/lib/parse_ini.c | |||
@@ -1,24 +1,24 @@ | |||
1 | /***************************************************************************** | 1 | /***************************************************************************** |
2 | * | 2 | * |
3 | * Monitoring Plugins parse_ini library | 3 | * Monitoring Plugins parse_ini 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 | 23 | ||
24 | #include "common.h" | 24 | #include "common.h" |
@@ -131,7 +131,7 @@ np_get_defaults(const char *locator, const char *default_section) | |||
131 | if (inifile == NULL) | 131 | if (inifile == NULL) |
132 | die(STATE_UNKNOWN, _("Can't read config file: %s\n"), | 132 | die(STATE_UNKNOWN, _("Can't read config file: %s\n"), |
133 | strerror(errno)); | 133 | strerror(errno)); |
134 | if (read_defaults(inifile, i.stanza, &defaults) == FALSE) | 134 | if (!read_defaults(inifile, i.stanza, &defaults)) |
135 | die(STATE_UNKNOWN, | 135 | die(STATE_UNKNOWN, |
136 | _("Invalid section '%s' in config file '%s'\n"), i.stanza, | 136 | _("Invalid section '%s' in config file '%s'\n"), i.stanza, |
137 | i.file); | 137 | i.file); |
@@ -157,7 +157,8 @@ np_get_defaults(const char *locator, const char *default_section) | |||
157 | static int | 157 | static int |
158 | read_defaults(FILE *f, const char *stanza, np_arg_list **opts) | 158 | read_defaults(FILE *f, const char *stanza, np_arg_list **opts) |
159 | { | 159 | { |
160 | int c, status = FALSE; | 160 | int c = 0; |
161 | bool status = false; | ||
161 | size_t i, stanza_len; | 162 | size_t i, stanza_len; |
162 | enum { NOSTANZA, WRONGSTANZA, RIGHTSTANZA } stanzastate = NOSTANZA; | 163 | enum { NOSTANZA, WRONGSTANZA, RIGHTSTANZA } stanzastate = NOSTANZA; |
163 | 164 | ||
@@ -219,7 +220,7 @@ read_defaults(FILE *f, const char *stanza, np_arg_list **opts) | |||
219 | die(STATE_UNKNOWN, "%s\n", | 220 | die(STATE_UNKNOWN, "%s\n", |
220 | _("Config file error")); | 221 | _("Config file error")); |
221 | } | 222 | } |
222 | status = TRUE; | 223 | status = true; |
223 | break; | 224 | break; |
224 | } | 225 | } |
225 | break; | 226 | break; |