fix segfault with back debug options
Adrian Smith
11 years ago
108 | 108 | char *l = strtok(optarg, "="); |
109 | 109 | char *v = strtok(NULL, "="); |
110 | 110 | log_level new = WARN; |
111 | if (!strcmp(v, "info")) new = INFO; | |
112 | if (!strcmp(v, "debug")) new = DEBUG; | |
113 | if (!strcmp(v, "sdebug")) new = SDEBUG; | |
114 | if (!strcmp(l, "all") || !strcmp(l, "slimproto")) log_slimproto = new; | |
115 | if (!strcmp(l, "all") || !strcmp(l, "stream")) log_stream = new; | |
116 | if (!strcmp(l, "all") || !strcmp(l, "decode")) log_decode = new; | |
117 | if (!strcmp(l, "all") || !strcmp(l, "output")) log_output = new; | |
111 | if (l && v) { | |
112 | if (!strcmp(v, "info")) new = INFO; | |
113 | if (!strcmp(v, "debug")) new = DEBUG; | |
114 | if (!strcmp(v, "sdebug")) new = SDEBUG; | |
115 | if (!strcmp(l, "all") || !strcmp(l, "slimproto")) log_slimproto = new; | |
116 | if (!strcmp(l, "all") || !strcmp(l, "stream")) log_stream = new; | |
117 | if (!strcmp(l, "all") || !strcmp(l, "decode")) log_decode = new; | |
118 | if (!strcmp(l, "all") || !strcmp(l, "output")) log_output = new; | |
119 | } else { | |
120 | usage(argv[0]); | |
121 | exit(0); | |
122 | } | |
118 | 123 | } |
119 | 124 | break; |
120 | 125 | case 'm': |