From f6ef5170fab6eb928986ad70a4d03c5035f2d023 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 13 Aug 2005 16:04:40 +0000 Subject: [PATCH] personally, I'm much more comfortable using hex for log levels... --- servers/slapd/main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/servers/slapd/main.c b/servers/slapd/main.c index 1cac009c99..1096af18fc 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -404,7 +404,17 @@ int main( int argc, char **argv ) slap_debug |= level; } else { - slap_debug |= atoi( optarg ); + int level; + char *next = NULL; + + level = strtol( optarg, &next, 0 ); + if ( next == NULL || next[ 0 ] != '\0' ) { + fprintf( stderr, + "unrecognized log level " + "\"%s\"\n", optarg ); + goto destroy; + } + slap_debug |= level; } #else if ( atoi( optarg ) != 0 )