aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/logging.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/logging.c b/src/logging.c
index 0816570..f58265f 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -175,17 +175,19 @@ void log_parse_category_mask(struct log_target* target, const char *_mask)
category_token = strtok(mask, ":");
do {
for (i = 0; i < osmo_log_info->num_cat; ++i) {
+ size_t length, cat_length;
char* colon = strstr(category_token, ",");
- int length = strlen(category_token);
- int cat_length = strlen(osmo_log_info->cat[i].name);
+
+ if (!osmo_log_info->cat[i].name)
+ continue;
+
+ length = strlen(category_token);
+ 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;
-
if (colon)
length = colon - category_token;