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:
+1
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user