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 | 77ff9d36b42ca9d3659459f37638a4dc65e45cc7 (patch) | |
tree | b75d2b5342b8ea67dcc58f815edeed7f89ab5fba /radsecproxy.c | |
parent | 988b7a71fb925531ae02b208ef7508c5d047314d (diff) |
changed to using gconfig lint type for loglevel
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/branches/release-1.1@295 e88ac4ed-0b26-0410-9574-a7f39faa03bf
Diffstat (limited to 'radsecproxy.c')
-rw-r--r-- | radsecproxy.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/radsecproxy.c b/radsecproxy.c index df0bcfb..44a37f6 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -3090,7 +3090,7 @@ void confrewrite_cb(struct gconffile **cf, char *block, char *opt, char *val) { } void getmainconfig(const char *configfile) { - char *loglevel = NULL; + long int loglevel = LONG_MIN; struct gconffile *cfs; cfs = openconfigfile(configfile); @@ -3122,7 +3122,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, @@ -3135,11 +3135,10 @@ void getmainconfig(const char *configfile) { tlsfree(); rewritefree(); - 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; } } |