diff options
author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2023-10-15 17:01:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-15 17:01:25 (GMT) |
commit | fff1014d1323980d5e969f31a5a17132482422ac (patch) | |
tree | 0d0980d41f95385cc0137ec86e7a1cea0065e04c /lib/parse_ini.c | |
parent | b1801c10846283176622db21974fe5003602630d (diff) | |
parent | ddbabaa3b659bed9dcf5c5a2bfc430fb816277c7 (diff) | |
download | monitoring-plugins-fff1014d1323980d5e969f31a5a17132482422ac.tar.gz |
Merge pull request #1937 from RincewindsHat/replace_booleans_in_lib
Replace old school booleans in lib
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; |