diff options
Diffstat (limited to 'nslcd/cfg.c')
| -rw-r--r-- | nslcd/cfg.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/nslcd/cfg.c b/nslcd/cfg.c index b0a4847..45dc246 100644 --- a/nslcd/cfg.c +++ b/nslcd/cfg.c @@ -25,6 +25,7 @@ #include "config.h" +#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -160,16 +161,16 @@ static int get_int(const char *filename, int lnr, return atoi(token); } -static int parse_boolean(const char *filename, int lnr, const char *value) +static bool parse_boolean(const char *filename, int lnr, const char *value) { if ((strcasecmp(value, "on") == 0) || (strcasecmp(value, "yes") == 0) || (strcasecmp(value, "true") == 0) || (strcasecmp(value, "1") == 0)) - return 1; + return true; else if ((strcasecmp(value, "off") == 0) || (strcasecmp(value, "no") == 0) || (strcasecmp(value, "false") == 0) || (strcasecmp(value, "0") == 0)) - return 0; + return false; else { log_log(LOG_ERR, "%s:%d: not a boolean argument: '%s'", @@ -178,7 +179,7 @@ static int parse_boolean(const char *filename, int lnr, const char *value) } } -static int get_boolean(const char *filename, int lnr, +static bool get_boolean(const char *filename, int lnr, const char *keyword, char **line) { char token[32]; @@ -187,10 +188,10 @@ static int get_boolean(const char *filename, int lnr, return parse_boolean(filename, lnr, token); } -static const char *print_boolean(int bool) +static const char *print_boolean(bool val) { - if (bool) return "yes"; - else return "no"; + if (val) return "yes"; + else return "no"; } static int parse_loglevel(const char *filename, int lnr, const char *value) |
