log: explicitly size log_target_max_level()

We always validate that the target value is below _LOG_TARGET_SINGLE_MAX
before acessing it, but we don't actually size the array like that.
let's fix that.

This doesn#t effectively change anything, but it makes things more
explicit what the limit here is.
This commit is contained in:
Lennart Poettering
2025-03-04 18:07:00 +01:00
parent 88400145ea
commit 4f4c37bc07
+1 -1
View File
@@ -50,7 +50,7 @@ static void *log_syntax_callback_userdata = NULL;
static LogTarget log_target = LOG_TARGET_CONSOLE;
static int log_max_level = LOG_INFO;
static int log_target_max_level[] = {
static int log_target_max_level[_LOG_TARGET_SINGLE_MAX] = {
[LOG_TARGET_CONSOLE] = INT_MAX,
[LOG_TARGET_KMSG] = INT_MAX,
[LOG_TARGET_SYSLOG] = INT_MAX,