logging: fix parsing of logging mask (-d DMI case)

Without this patch, `-d DMI' enables logging for DMI and DMIB.

Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
This commit is contained in:
Pablo Neira Ayuso 2011-08-11 13:24:18 +02:00 committed by Harald Welte
parent e581516b26
commit 300e78d3e5
1 changed files with 5 additions and 0 deletions

View File

@ -157,6 +157,11 @@ void log_parse_category_mask(struct log_target* target, const char *_mask)
for (i = 0; i < osmo_log_info->num_cat; ++i) {
char* colon = strstr(category_token, ",");
int length = strlen(category_token);
int cat_length = strlen(osmo_log_info->cat[i].name);
/* Use longest length not to match subocurrences. */
if (cat_length > length)
length = cat_length;
if (!osmo_log_info->cat[i].name)
continue;