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>
diff --git a/src/logging.c b/src/logging.c
index 11d63ac..e85e8fc 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -157,6 +157,11 @@
 		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;