- char *next = argv[i];
- if ( i < argc-1 && next[0] == '-' && next[1] == 'd' )
- {
- char subsys[64];
- int level;
- char *optarg = argv[i+1];
- char *index = strchr( optarg, '=' );
- if ( index != NULL )
- {
- *index = 0;
- strcpy ( subsys, optarg );
- level = atoi( index+1 );
- if ( level <= 0 ) level = lutil_mnem2level( index + 1 );
- lutil_set_debug_level( subsys, level );
- *index = '=';
- }
- else
- {
- global_level = atoi( optarg );
- }
- }
+ char *next = argv[i];
+ if ( i < argc-1 && next[0] == '-' && next[1] == 'd' )
+ {
+ char subsys[64];
+ int level;
+ char *optarg = argv[i+1];
+ char *index = strchr( optarg, '=' );
+ if ( index != NULL )
+ {
+ *index = 0;
+ strcpy ( subsys, optarg );
+ level = atoi( index+1 );
+ if ( level <= 0 ) level = lutil_mnem2level( index + 1 );
+ lutil_set_debug_level( subsys, level );
+ *index = '=';
+ }
+ 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;
+ }
+ }