diff options
-rw-r--r-- | src/logging.c | 5 | ||||
-rw-r--r-- | tests/logging/logging_test.err | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/logging.c b/src/logging.c index 2a8bfdc8..d32ca43a 100644 --- a/src/logging.c +++ b/src/logging.c @@ -336,6 +336,11 @@ err: * which should never happen unless even the DLGLOBAL category is missing. */ static inline int map_subsys(int subsys) { + /* Note: comparing signed and unsigned integers */ + + if (subsys > 0 && ((unsigned int)subsys) >= osmo_log_info->num_cat_user) + subsys = DLGLOBAL; + if (subsys < 0) subsys = subsys_lib2index(subsys); diff --git a/tests/logging/logging_test.err b/tests/logging/logging_test.err index f4e9c1f4..4527d835 100644 --- a/tests/logging/logging_test.err +++ b/tests/logging/logging_test.err @@ -4,4 +4,5 @@ DRLL You should see this DLGLOBAL You should see this on DLGLOBAL (a) DLGLOBAL You should see this on DLGLOBAL (b) DLGLOBAL You should see this on DLGLOBAL (c) +DLGLOBAL You should see this on DLGLOBAL (d) DLGLOBAL You should see this on DLGLOBAL (e) |