]> git.sur5r.net Git - openldap/commitdiff
personally, I'm much more comfortable using hex for log levels...
authorPierangelo Masarati <ando@openldap.org>
Sat, 13 Aug 2005 16:04:40 +0000 (16:04 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 13 Aug 2005 16:04:40 +0000 (16:04 +0000)
servers/slapd/main.c

index 1cac009c99b3eaeb9f366d9eae9a0e0fb00efc4f..1096af18fcc3fcd49e88408538b7de54ddf8a478 100644 (file)
@@ -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 )