diff options
author | venaas <venaas> | 2008-07-03 11:11:58 +0000 |
---|---|---|
committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2008-07-03 11:11:58 +0000 |
commit | 6e0e72a0a25dc55e38ad2828a3acdba9dfc3907e (patch) | |
tree | d68f5aabd4322e9b1cce470195fc89e1e5f8ab72 | |
parent | d239bb28d2d199dd5263b059b312e889e4616289 (diff) |
changed to using gconfig lint type for loglevel
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@295 e88ac4ed-0b26-0410-9574-a7f39faa03bf
-rw-r--r-- | radsecproxy.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/radsecproxy.c b/radsecproxy.c index b6071a6..50a0478 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -3615,7 +3615,7 @@ int confrewrite_cb(struct gconffile **cf, void *arg, char *block, char *opt, cha } void getmainconfig(const char *configfile) { - char *loglevel = NULL; + long int loglevel = LONG_MIN; struct gconffile *cfs; cfs = openconfigfile(configfile); @@ -3647,7 +3647,7 @@ void getmainconfig(const char *configfile) { "ListenAccountingUDP", CONF_STR, &options.listenaccudp, "SourceUDP", CONF_STR, &options.sourceudp, "SourceTCP", CONF_STR, &options.sourcetcp, - "LogLevel", CONF_STR, &loglevel, + "LogLevel", CONF_LINT, &loglevel, "LogDestination", CONF_STR, &options.logdestination, "LoopPrevention", CONF_BLN, &options.loopprevention, "Client", CONF_CBK, confclient_cb, NULL, @@ -3659,11 +3659,10 @@ void getmainconfig(const char *configfile) { )) debugx(1, DBG_ERR, "configuration error"); - if (loglevel) { - if (strlen(loglevel) != 1 || *loglevel < '1' || *loglevel > '4') - debugx(1, DBG_ERR, "error in %s, value of option LogLevel is %s, must be 1, 2, 3 or 4", configfile, loglevel); - options.loglevel = *loglevel - '0'; - free(loglevel); + if (loglevel != LONG_MIN) { + if (loglevel < 1 || loglevel > 4) + debugx(1, DBG_ERR, "error in %s, value of option LogLevel is %d, must be 1, 2, 3 or 4", configfile, loglevel); + options.loglevel = (uint8_t)loglevel; } } |