From: Pierangelo Masarati Date: Sat, 13 Aug 2005 16:04:40 +0000 (+0000) Subject: personally, I'm much more comfortable using hex for log levels... X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~714 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f6ef5170fab6eb928986ad70a4d03c5035f2d023;p=openldap personally, I'm much more comfortable using hex for log levels... --- 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 )