mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-03 13:40:37 -05:00
fix global level usage (ITS 1143, 1144)
This commit is contained in:
parent
cf2cb85fab
commit
9909448880
1 changed files with 7 additions and 2 deletions
|
|
@ -126,7 +126,7 @@ void lutil_log_int(
|
|||
* break out of the loop.
|
||||
*/
|
||||
for( i = 0; i < numLevels; i++ ) {
|
||||
if ( levelArray[i] == NULL ) return;
|
||||
if ( levelArray[i] == NULL ) break;
|
||||
if ( ! strcasecmp( levelArray[i]->subsystem, subsys ) ) break;
|
||||
}
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ void lutil_log_int(
|
|||
* the requested output level, don't output it.
|
||||
*/
|
||||
if ( (level > global_level) &&
|
||||
((i > numLevels ) || ( level > levelArray[i]->level )) )
|
||||
((i > numLevels ) || (levelArray[i] == NULL) || ( level > levelArray[i]->level )) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -244,6 +244,11 @@ void lutil_log_initialize(int argc, char **argv)
|
|||
else
|
||||
{
|
||||
global_level = atoi( optarg );
|
||||
/*
|
||||
* if a negative number was used, make the global level the
|
||||
* maximum sane level.
|
||||
*/
|
||||
if ( global_level < 0 ) global_level = 65535;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue