log: Fix loglevel assignment

For some reason the optind was misused (maybe I broke it with prev patch)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov 2012-07-19 17:25:04 +04:00
parent 0b76ba375e
commit 76e7f12cb8
2 changed files with 3 additions and 1 deletions

View file

@ -134,7 +134,7 @@ int main(int argc, char *argv[])
break;
case 'v':
if (optind < argc - 1) {
char *opt = argv[optind + 1];
char *opt = argv[optind];
if (isdigit(*opt)) {
log_level = -atoi(opt);

2
log.c
View file

@ -101,6 +101,8 @@ void log_set_loglevel(unsigned int level)
current_loglevel = DEFAULT_LOGLEVEL;
else
current_loglevel = level;
pr_msg("Loglevel set to %d\n", level);
}
void print_on_level(unsigned int loglevel, const char *format, ...)